Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 triggers

Author  Topic 

gerardgel
Starting Member

3 Posts

Posted - 2008-09-12 : 07:17:16
can anyone tell me what is wrong with the following code as a trigger to hold information after it has been deleted.
thanks

CREATE OR REPLACE TRIGGER

info_access_bef_upd_row

BEFORE UPDATE ON

info_access

FOR EACH ROW

BEGIN

INSERT INTO history

(

agent_id,

logon_time,

information_id,

logoff_time,

deleted_date

)

VALUES

(

:old.agent_id,

:old.logon_tine,

:old.information_id,

:old.logoff_time,

sysdate

);

END;

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-09-12 : 08:04:21
Are you using Microsoft SQL Server ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-09-12 : 08:30:30
quote:
Originally posted by gerardgel

can anyone tell me what is wrong with the following code as a trigger to hold information after it has been deleted.
thanks

CREATE OR REPLACE TRIGGER

info_access_bef_upd_row

BEFORE UPDATE ON

info_access

FOR EACH ROW

BEGIN

INSERT INTO history

(

agent_id,

logon_time,

information_id,

logoff_time,

deleted_date

)

VALUES

(

:old.agent_id,

:old.logon_tine,

:old.information_id,

:old.logoff_time,

sysdate

);

END;



Post your question at oracle forums like www.orafaq.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-09-12 : 10:39:15
...or http://www.dbforums.com/forumdisplay.php?f=4

Boycotted Beijing Olympics 2008
Go to Top of Page
   

- Advertisement -