Home » SQL & PL/SQL » SQL & PL/SQL » Trigger - help!!!
Trigger - help!!! [message #36319] Fri, 16 November 2001 03:02 Go to next message
David Jeyathilak
Messages: 9
Registered: October 2001
Junior Member
Hi,
create table1{
qty number(10),
id varchar2(5)
}
I call the following trigger on update/insert on table1. How do I get the value of 'id' which was just inserted in table1?
create or replace trigger trgA
after update or insert on table1
declare
cursor c1 is select qty from table1 where id='value of id which was just inserted';
begin
end;

----------------------------------------------------------------------
Re: Trigger - help!!! [message #36320 is a reply to message #36319] Fri, 16 November 2001 03:13 Go to previous message
homer
Messages: 17
Registered: October 2001
Junior Member
Try this:

create table1{
qty number(10),
id varchar2(5)
}
I call the following trigger on update/insert on table1. How do I get the
value of 'id' which was just inserted in table1?
create or replace trigger trgA
after update or insert on table1
declare
cursor c1 is select qty from table1 where id=:new.id';
begin
end;

----------------------------------------------------------------------
Previous Topic: Executing a procedure at sql prompt
Next Topic: how do i print the no of records affected after my insert/update/delete statements in my procedure
Goto Forum:
  


Current Time: Wed Dec 25 09:51:08 CST 2024