Insert trigger
Posted in 1997
Topics: Stored Procedures & SPL, Triggers, Constraints & Referential Integrity, Platform-Specific Issues
Any help on this question will be greatly appreciated. Here's my situation : I have a table that has 3 columns, colA colB and colC. colA is an integer field, colB is an integer field, and colC is a datetime field. The integer field in colB holds a julian date (e.g.,19970123). colC allows NULLS. colA colB colC ---- ---- ---- 01 19970123 ? What I would like to do when a row is inserted into the table, is take the julian date value, and convert it to a datetime (1997-05-03, in this case) and insert that value into colC. I've been unable to find any Informix function that will do this conversion for me, so I wrote my own stored procedure to do it. I thought I would be able to call this stored procedure from an INSERT trigger, but according to the Informix doc, you can't use UPDATE statements in stored procedures called from INSERT triggers. From what I can gather from the Informix doc, I can't change the values of any column on the inserted row. Does anyone have any ideas? Some of my colleagues have told me that this type of operation is available in other RDBMS's, so I'm hoping there's some way to accomplish it in Informix. I know that I could call the stored procedure from the INSERT statement, or just perform the INSERT from the stored procedure, but I'd really like to do this in the form of a trigger operation. I'm running ODS 7.22.UC2 on Solaris 2.5.1. Thanks in advance for any help!!! -- Chris Kaeberlein Greenbrier and Russel, Inc. ckaeberlein@gr.com