Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating triggers

Status
Not open for further replies.

managergtc

IS-IT--Management
May 26, 2003
1
0
0
MX
Hi, dows anybody knows how to declare informix triggers, im inserting some data in my tables, but I have 1 field to be used as a timestamp and should always get the current date of the day when de record is being inserted in this table and I need to do this via a trigger. Any idea??

Thanks in advanced
 
Hi,

You may use keywords TODAY or CURRENT to do this.

Example:

CREATE TRIGGER upd_emp
UPDATE OF emp_sal ON emp
REFERENCING OLD AS olddata NEW AS newdata
FOR EACH ROW
(INSERT INTO trace_tab VALUES
(olddata.emp_no, olddata.emp_name, olddata.emp_sal,
newdata.emp_sal, CURRENT))

You can download an e-book (pdf) version of Trigger from:

Regards,
Shriyan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top