Stored procedure HELP
Posted in 1996
Hi:
Can someone help with the following stored procedure?
I am trying to insert a row in a table based on a select
statement returning no rows from a different table. The
on exception does not appear to set the esql to 100
(SQLNOTFOUND). Is there some other value that I must check?
Any help is appreciated:
Thank you
Sanjay
email rao00008@mc.duke.edu
************START OF PROCEDURE ****************************
create procedure test (xyz varchar(10))
returning int;
define tmp varchar(10);
define esql int;
on exception set esql
select name into tmp from temptable where name = xyx;
end exception with resume;
if (esql = 100) then
insert my row
end if
end procedure
********************END OF PROCEDURE ******************