Teradata substitute to TRUNCATE command
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Teradata substitute to TRUNCATE command Expand / Collapse
Author
Message
Posted 9/17/2009 9:03:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/20/2009 1:54:19 PM
Posts: 5, Visits: 53
HI

I have a table "table1" and a delete trigger created on that table, which populates "table2"

In oracle when we use TRUNCATE command on "table1" we get no rows inserted in "table2", whereas in teradata for each row, delete trigger inserts a row on "table2".
I have tried " DELETE ALL "
" DELETE FROM "

Is there a similar kind of command i can use in Teradata for above setup, so that rows are not inserted on DELETE ALL.

Thanks


~ Truth is stranger than fiction ~
Post #16861
Posted 9/18/2009 4:38:50 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/18/2009 4:36:17 AM
Posts: 5, Visits: 11
Are you using row-level trigger or a Teradata Triggered Statement ?
Post #16866
Posted 9/19/2009 8:59:41 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/20/2009 1:54:19 PM
Posts: 5, Visits: 53
Yes, am using Row Level trigger

create deltrig1 after delete on deltest1
REFERENCING OLD AS old_row
for each row (insert into deltest2 values(old_row."key",'row delted');)


~ Truth is stranger than fiction ~
Post #16874
Posted 9/20/2009 8:54:10 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/5/2009 4:40:02 PM
Posts: 717, Visits: 466
You should always try to rewrite a row trigger to a statement trigger, which is much faster.

ALTER TRIGGER foo DISABLED;
DELETE FROM tab;
ALTER TRIGGER foo ENABLED;

Dieter
Post #16884
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 11:20am

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.453. 9 queries. Compression Disabled.