Hi all.
I am running a stored procedure in a loop -- this Stored procedure
inserts one record at a time.
After inserting about 1326 records, my thread crashes and I get the
following error:
"Got database error. [DB2/NT] SQL0805N Package "NULLID.SYSLH203
0X5359534C564C3031" was not found. SQLSTATE=51002"
Here's the body of the stored procedure.
===================
create PROCEDURE db2.sp_add_log
(
IN PLAYEROID_in CHAR(36),
IN PLAYTIME_in CHAR(23),
IN CONTENTNAME_in VARCHAR (1024),
IN CONTENTOID_in CHAR(36),
IN REASON_in VARCHAR (256),
IN DATAFIELD_in VARCHAR (256)
)
LANGUAGE SQL
BEGIN
DECLARE SQLSTATE CHAR(5);
DECLARE not_found CONDITION FOR SQLSTATE '02000';
DECLARE EXIT HANDLER FOR not_found
SIGNAL SQLSTATE '02444';
SET PLAYTIME_in = REPLACE(PLAYTIME_in,'T',' ');
insert into DB2.PLAYLOGS_
(PLAYEROID_, PLAYTIME_,CONTENTNAME_,CONTENTOID_,REASON_, DATAFIELD_)
values
(PLAYEROID_in, PLAYTIME_in, CONTENTNAME_in, CONTENTOID_in, REASON_in,
DATAFIELD_in);
END
======================
Any ideas what this error message might mean?
I found out from the IBM web-site what Error 51002 means:
51002 The package corresponding to an SQL statement execution request
was not found.
What package is it referring to? How could I suddenly (after inserting
1326 records) need this package NULLID.SYSLH203 0X5359534C564C3031 ?
My primary key is a composite key created by combining the 1st 3 fields
-- could it be that it got a NULL value for one of those fields and
this is DB2's way of telling me about the problem ?
I found somebody else who had a similar grievance:
http://www.lazydba.com/db2/2__5491.html -- it says that I was probably
not using the correct way to open/close cursors....
Thanks,
-Anil