RE: create a very simple trigger...

RE: create a very simple trigger...

 

  

True, but I still think the original trigger will cause a mutating table
as the trigger is inserting into the same table that the trigger is
fired against.

-----Original Message-----
From: Cloninger Jason [mailto:[Email address protected]
Sent: 06 September 2007 16:35
To: Rowe,KP,Kevin,JPGA4Y C
Subject: RE: create a very simple trigger...

**A LazyDBA.com subscriber has responded to your lazydba.com post**
**LazyDBA.com mail shield has forwarded you this email, **and removed
any attachments, and kept your email address secret **from this person,
and any viruses/trojans.
**If you reply to this email, the person will see your email address as
normal **Anything below this line is the original email text


No need to execute SQL "select sysdate from dual;"... SYSDATE is
an Oracle keyword and will be recognized in PL/SQL when used as the
previous answers indicated...

insert into VALOR(dt_inser) values(sysdate);



Thank you,

Jason Cloninger
Database Administrator
Smurfit Stone Container Corporation
Phone: (314) 656-5539
Email: [Email address protected]
On-Call DBA: (314) 252-3300



-----Original Message-----
From: kevin [Email address protected]
Sent: Thursday, September 06, 2007 10:19 AM
To: LazyDBA Discussion
Subject: RE: create a very simple trigger...

Hi,
Can you not just do :

insert into VALOR(dt_inser) select sysdate from dual; end trg_dt_inser;

However I don't think your trigger will work as you will get a mutating
table problem.

Cheers, Kev.

-----Original Message-----
From: David NGUYEN
[mailto:oracledba-ezmlmshield-x34906818.[Email address protected]
Sent: 06 September 2007 16:01
To: LazyDBA Discussion
Subject: create a very simple trigger...

hi experts,

i just want to create a trigger , that inserts into VALOR(dt_inser)
column the sysdate each time there is a insert commant on the VALOR
table.
i dont know how to declare sysdate.
(dt_inser date null) column .
thanks for your suggestions.

CREATE OR REPLACE TRIGGER trg_dt_inser
before insert
on VALOR for each row
begin
insert into VALOR(dt_inser) values('sysdate'); end trg_dt_inser;


david...


---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html




---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html





Oracle LazyDBA home page