Re: Trigger that acts on referencing table
Posted in 1997
At 09:40 PM 8/13/97 EDT, you wrote:
}
}Hi folks,
}
}I'd like to incorporate the following into my table designs, but it
}doesn't appear that Informix supports the capability:
}
}Table XYZ (
} <columns>...
} modified_datetime datetime year to second
})
}
}Each time a row is inserted or updated, I would like to have a trigger
}automatically update the modified_datetime so that I always know when
}a row was last changed.
}
}Informix triggers don't seem to let me update the time in this table
}on an insert (I can update the time in an update trigger if that column
}is not referenced in the update).
}
}If anyone has needed to do this, how did you implement it? Is there a
}better way to provide this sort of information about the row?
}
Is it possible to use the DEFAULT clause of the create table statement?
That way you won't have to worry about embedding extra code to store the
modified_datetime value, and also you can use other utilities (like dbload,
isql, dbaccess) to insert rows without added headache. Sorry I don't have
the manuals close by; maybe someone else cane give you the exact syntax, or
you can check your I-SQL Reference manual.
}Thanks,
}Lorrie Gagnon
}Hewlett Packard Company, San Diego CA
}lgagnon@sdd.hp.com
}
Best regards,
Nigel
+--------------------------------------------------------------------+
|Name : Edmund Nigel Gall Atlantic Avenue |
|Title : Information Systems Specialist Pt. Lisas Industrial Estate|
|Company: Process Plant Services Ltd. Pt. Lisas, Couva |
| Trinidad & Tobago, W.I. |
| Business Personal |
| mailto:nigelg@ppsl.com mailto:nigelg@ppsl.com |
| Phone : (868) 636 3153/2878/3195 Phone : (868) 662 6611 |
| Fax : (868) 679 3770 Fax : (868) 662 6611 |
+------------------------ http://www.ppsl.com -----------------------+