If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: sequence

hi,

create or replace procedure testproc
is
insert into testtab values(test_seq.nextval(),'abcd');
end;
/
above is the code sample.This procedure is giving me a compilation error saying sequnce couldnot be referenced here.But in a normal insert the statment is working fine.
i want to auto generate the primary key firing the insert from the stored procedure.
How could i do it.
PLS advice.
Thanx
kaushik

Re: sequence

Originally posted by kaushik.mondal
hi,

create or replace procedure testproc
is
insert into testtab values(test_seq.nextval(),'abcd');
end;
/
above is the code sample.This procedure is giving me a compilation error saying sequnce couldnot be referenced here.But in a normal insert the statment is working fine.
i want to auto generate the primary key firing the insert from the stored procedure.
How could i do it.
PLS advice.
Thanx
kaushik

I don't know why you have this problem, although your procedure as shown is invalid (no BEGIN). It works for me: