Triggers and restoring old data.
Posted in 1994
Topics: Triggers, Constraints & Referential Integrity
I have been charged with solving a nasty problem. I must create a program that must insert some old data from tape into a couple of tables. The trick is that the tables may have changed slightly; there may be new columns, maybe a column name change, maybe a column set to "not null". The first thing I want to do is to deal with the case where a new "not null" column has been added. I guess I can load the data in ok but I need to get a default value for the new column from somewhere. After checking out triggers for the first time it seems that they cannot do what I want them to do: When a row is inserted with no value for column X then I want the trigger (or some other mechanism) to substitute some default value for column X. syscolval entries don't help either since they only operate from forms. So to the questions: A) How do other people deal with this sort of problem (if at all). B) Is there any mechanism (apart from programmatic) that can assign a default value to a column on insert. Any hints accepted with my heartfelt appreciation. ====================================================================== ajs@labsys.com.au (Adam Skeggs) ======================================================================