Unanswered: SQLSTATE and SQLCODE not correctly filled in a Stored Procedure
Hello, I have the following stored procedure but the error variables are not populated with the output error code.
In my case it should abort for duplicates , if I execute the SQL I have the folling error messages
--One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because ---the primary key,
--unique constraint or unique index identified by "1" constrains table "BDV.SAT_PERSON_GC" from having duplicate values for the index key..
--SQLCODE=-803, SQLSTATE=23505, DRIVER=4.18.60
But with my stored procedure, it abort but the SQLCODE and the SQLSTATE have the initial values ...
is sqlstate 38t00 a valid value ??? -->DB21050E "38T00" is not a valid SQLSTATE
see spserver.db2 in samples directory to have some correct samples...
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be