vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| create trigger abc_ins insert on abc referencing new as abc_new for each row ( update abc set insdate = to_char(today, "%Y%m%d") where field1 = abc_new.field1 ); Would probably be better... Andrew Ford (512) 977-2000 ext. 32368 -----Original Message----- From: Ford, Andrew G Sent: Friday, October 28, 2005 5:01 PM To: 'Quetzalcoatl'; informix-list@iiug.org Subject: RE: a how can I do this in Informix question What about: create trigger abc_ins insert on abc referencing new as abc_new for each row ( update abc set insdate = (year(today) || month(today) || day(today)) where field1 = abc_new.field1 ); This assumes that field1 is the primary key of abc. Andrew -----Original Message----- From: owner-informix-list@iiug.org [mailto On Behalf Of Quetzalcoatl Sent: Thursday, October 27, 2005 2:36 PM To: informix-list@iiug.org Subject: a how can I do this in Informix question Hello, I have a problem in Informix that I need to solve. I have table Table ABC { Field1 integer, Field2 char(5), Insdate integer } What I want now is when an insert occurs on this table on the fields (Field1 and Field2) that afterwards the fields Insdate is filled with the date of today but stored as a number in the format YYYYMMDD. Example: Insert into ABC (Field1, Field2) values (1, "Wim"); then should the query Select * from ABC; return: Field1 Field2 Insdate 1 Wim 20051027 My collegue found how to do it in Oracle and now I want to prove it also can be done in Informix. I hope. Else me and my big mouth :-) So help me please. Thanks, Wim sending to informix-list |
| Thread Tools | |
| Display Modes | |
|
|