Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXIT HANDLER FOR SQLEXCEPTION

Status
Not open for further replies.

oana12

Programmer
Jan 6, 2005
21
CA
Hi,
I have this procedure
CREATE PROCEDURE t (
IN PUSERID INTEGER,
IN PDATE TIMESTAMP,
, OUT PSQLCODE INTEGER)

RESULT SETS 0 LANGUAGE SQL
BEGIN NOT ATOMIC
DECLARE SQLCODE INT;
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET AT_END = 1;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
SET PSQLCODE = SQLCODE;
SET PSQLCODE = 0;
update b
set value=bvalue
where userid=puserid
and date=pdate;
commit;
end;

When I execute this procedure it is failling with SQLCODE=0.
If I execute only the update statement it is ok. Why in procedure is not executed and is finished with SQLCODE exit number?
In my table I have 2.500.000 records.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top