Unanswered: the SQL1131N error when I call a stored procedure
I write my stored procedure by embedding SQL statements in C. I have successfully builded the stored procedure by execute the command "bldsrv csp runstat my_database" and the executable csp program has been copied to "/home/db2inst1/sqllib/function/". The file csp.sqc is my stored procedure in C. and I have successfully cataloged the stored procedures by entering:db2 -td@ -vf csp.db2. But when I call the stored procedure, the DB2 raise the SQL1131N error code, e.g.
$ db2 "call runstat('db2inst1.test', ?, ?)"
SQL1131N DARI (Stored Procedure) process has been terminated abnormally. SQLSTATE=38503
My stored procedure only invoke the sqlustat(runstats) administrative API function. My OS is AIX4.3.3, ML10, DB27.2 FP7.
$ cat csp.db2
CREATE PROCEDURE RUNSTAT (IN scmtab varchar(100), OUT error_code int, OUT error_label varchar(71))
DYNAMIC RESULT SETS 0
PARAMETER STYLE GENERAL
READS SQL DATA
PROGRAM TYPE SUB
EXTERNAL NAME 'csp!runstat'@