Re: default field values / trigger / stored procedures
Posted in 1998
Ingo Trapphagen wrote: > > Hi, > > my problem is very simple and maybe there are many possibilities to > solve the problem: > okay, here it is: > i have to save the username and a time-stamp in a table for the > following to actions: insert, update! > i think a trigger is the best way to handle it. does somebody tried it > before or has someone another idea for this ?? > is it possible to create only a trigger without creating a stored > procedure to do the same job ?? For insert use DEFAULT constraints to insert the userid and timestamp. You cannot do it in a trigger prior to 7.30 anyway (you do not state your version and platform). For updates you will need a trigger. Yes you can do this without a stored procedure but it is easier to maintain the trigger if it points to a procedure rather than having the update code inline. Art S. Kagel