|
-
Hi there,
in a PL/SQL-Procedure or script, you can use the following command:
EXECUTE IMMEDIATE 'truncate table dingsda';
Assuming that you do not want to clear all tables of the database, but just of one schema in an instance, use a Cursor-Loop feeded by 'select table_name from user_tables' and concat the table_name to your truncate-command, then execute it:
DECLARE
CURSOR c_tables IS
SELECT table_name FROM user_tables;
BEGIN
FOR r_tables IN c_tables LOOP
EXECUTE IMMEDIATE 'truncate table '||r_tables.table_name;
END LOOP
END;
To schedule, you could (on Unix) use the cron to start the scripts via an sql-plus call, or use the DBMS_JOB-package.
cu
6502
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|