Hi,
Following is the Stored procedure definition which is called by C++
application, which returns SQLCODE
CREATE PROCEDURE t1
LANGUAGE SQL
BEGIN
DECLARE SQLCODE INT;
BEGIN
DECLARE l_sqlcode INT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION,SQLWARNING,NOT FOUND
SET l_sqlcode = SQLCODE;
INSERT INTO SESSION.#m values (1);
COMMIT;
RETURN l_sqlcode;
END;
END!
The Temporary table is created in C++ application on DB2 database after
establishing the database connection
csSQL = "DECLARE GLOBAL TEMPORARY TABLE SESSION.\"#m\" AS( id
int)DEFINITION ONLY WITH REPLACE ON COMMIT PRESERVE ROWS NOT LOGGED";
stat = myConnection.executeSql(csSQL);
cout << "status of create table m"<<
stat.status().message()<<endl;
spProc = myDbase.storedProc("t1", myConnection);
udResult = spProc.execute();
vlRetValue = spProc.returnValue();
if( vlRetValue.asInt() != 0 )
{
cout << "Store Procedure t1 returns Error #: "
<< vlRetValue.asString() <<
spProc.status().message()<< endl;
}
else {
cout << "Store Procedure t1 returns success." << endl;
}
When Stored procedure is called in the application the following message
is displayed
status of create table m
Store Procedure t1 returns Error #: -727
Please share any ideas on this issue.
Thanks,
Jayaprakash.
DB2 & UDB email list listserv db2-l LazyDBA home page