Hello,

I have the following table:

CREATE TABLE test(
id fixed(10) not null primary key
, uname varchar(32) DEFAULT USER
, uname_upd varchar(32) DEFAULT USER
, text varchar(128) NOT NULL
)

Now I want to have a trigger, that updates the 'uname_upd' column with the
user name that updates the record:

CREATE TRIGGER test_update FOR test AFTER UPDATE EXECUTE (
TRY
  UPDATE owner.test SET uname_upd = USER WHERE id = :OLD.id;
CATCH
  STOP ($rc, 'Unexpected error');
)

This works fine, but I want to know, if there is a better way.
Does the DB-Kernel detects the endless loop this trigger normaly should
produce?
Could you also tell me, how long the trigger name can be?

Mit besten Gruessen
Kolja Kleist (Senior Developer)
____________________________________
MediaTransfer AG
Netresearch & Consulting
Rothenbaumchaussee 38, 20148 Hamburg
Tel: (040) 669 625 16
Fax: (040) 669 625 29
URL: http://b2b.mediatransfer.de
____________________________________

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to