I've created an ASP gridview and made it editable. It displays the information that was entered into a SQL table plus a time stamp and the submitter's user ID.
In the event information is edited on a specific row, I need to overwrite the time stamp, and requestor on that row to show who edited the entry.
I've found this example of a trigger for oracle but don't know how to modify it to work with SQL.
CREATE OR REPLACE TRIGGER "TR_SAMPLE"
BEFORE INSERT OR UPDATE
ON table
FOR EACH ROW
BEGIN
IF INSERTING
THEN
:new.vpreparedb y := NVL (:new.vprepared by, USER);
:new.dentrydate := NVL (:new.dentrydat e, SYSDATE);
ELSE
:new.vmaintaine dby := NVL (:new.vmaintain edby, USER);
:new.dmaintaine ddate := NVL (:new.dmaintain eddate, SYSDATE);
END IF;
END;
In the event information is edited on a specific row, I need to overwrite the time stamp, and requestor on that row to show who edited the entry.
I've found this example of a trigger for oracle but don't know how to modify it to work with SQL.
CREATE OR REPLACE TRIGGER "TR_SAMPLE"
BEFORE INSERT OR UPDATE
ON table
FOR EACH ROW
BEGIN
IF INSERTING
THEN
:new.vpreparedb y := NVL (:new.vprepared by, USER);
:new.dentrydate := NVL (:new.dentrydat e, SYSDATE);
ELSE
:new.vmaintaine dby := NVL (:new.vmaintain edby, USER);
:new.dmaintaine ddate := NVL (:new.dmaintain eddate, SYSDATE);
END IF;
END;
Comment