oracle truncate table
truncate command in oracle deletes all records in the table. this operation is faster than delete command.
because of following reasons
delete command records deleted entries will be logged into log file. where as truncate doesn't.
delete command fires triggers, where as truncate don't.
Once truncate occurs on a table, user cannot rollback data.
Syntax:
truncate table [tablename];
Multiple table truncates
truncate table [table1],[table2] ...[table n];
Truncate a tables associated with foreign key reference:
Steps to truncate tables associated with primary key and foreign key references.
Step 1) Truncate all child tables
Step 2) Truncate parent table.
Step 1)Truncate table [child table 1],[child table 2]...[child table n];
Step 2)Truncate table [parent table 1] [parent table 2] ...[parent table n];
Tags: oracle Truncate table,oracle truncate tables, oracle truncate table with foreign key references, oracle truncate multiple tables, truncate trigger in oracle.
No comments:
Post a Comment