[Q] Trigger on Update to Save Off Entire OLD Row
Posted in 1994
I am in the process of picking up the knowledge of USING TRIGGERS.
I have tried various ways of performing the following but without success:
============================================================================
CREATE TRIGGER update_emit
UPDATE ON "cso".emit
REFERENCING OLD AS old_emit
FOR EACH ROW (INSERT INTO devellogs:"cso".emit values (old_emit.*))# ^
# 201: A syntax error has occurred.
#
============================================================================
As you can tell, I am trying to insert the ENTIRE prior version of a record
into the development log database I have created. I am also in the process
of creating a common script for several databases and would hate to have to
list each and every field within each record as the design (sadly) calls for
me to save the entire old record for more than 30 tables in each database.
Please advise me on how to solve the listed error. If you have any advise
on the use of triggers within multiple database environments (development,
test, production, all having the same tables and require the same logging
structure), please send those comments to me as well.
Thank you. Take care.
Clifton
--
----------------------------------------------------------------------------
Clifton M. Bean Live and in Person in Saint Petersburg, Russia
Grand Hotel Europe, #444 Contracted by KPMG Peat Marwick (PEG), Wash, D.C.
Saint Petersburg, Russia -------------------------------------------------
Voice: +7-812-119-6000 Snail Mail: Grand Hotel Europe, P.O. Box 53
Fax: +7-812-119-6001/6003 SF-535 01 Lappeenranta, Finland
----------------------------------------------------------------------------
Current: root@clifbean.spb.su (Contract under Undetermined Extension)
----------------------------------------------------------------------------