By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,610 Members | 1,677 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,610 IT Pros & Developers. It's quick & easy.

Translate this Oracle Trigger ...

P: n/a
I'm new to DB2 and our team is in the process of
migrating from Oracle to DB2.

Assuming new.created_date is now a TIMESTAMP,
what would be the DB2 translation of this Oracle
trigger?

Thanks.

CREATE OR REPLACE TRIGGER "BZ".atable_created_date
BEFORE INSERT ON atable
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
BEGIN
SELECT sysdate INTO :new.created_date
FROM DUAL;
END;
/

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ian
gi*******************@yahoo.com wrote:
I'm new to DB2 and our team is in the process of
migrating from Oracle to DB2.

Assuming new.created_date is now a TIMESTAMP,
what would be the DB2 translation of this Oracle
trigger?

Thanks.

CREATE OR REPLACE TRIGGER "BZ".atable_created_date
BEFORE INSERT ON atable
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
BEGIN
set new.created_date = current timestamp;
END;
/


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.