Gurus,
I have a verb big problem which I'm unable to explain.
We have a DB2 V6.1.0 on AIX 4.3
I want to make a C stored procedure which at the end will be called by a PHP
script.
The development server was an UDB V6.1.0 on W2K.
Everything went well. I was able to call the stored proc from C and from
Delphi.
After we have installed the proc on the production machine.
Compiled, linked well after copied to the right place SQLLIB/function
Declared the proc:
CREATE PROCEDURE DB2NC.S_GETPRODUCTLIST
(IN BS_BSREF INTEGER,
IN DATEPARAM DATE
)
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'sbprogs1!S_GetProductList'
LANGUAGE C
PARAMETER STYLE DB2SQL
DETERMINISTIC
FENCED
NO DBINFO
CALLED ON NULL INPUT
PROGRAM TYPE SUB
Here is the C header:
SQL_API_RC SQL_API_FN S_GetProductList(SQLUDF_INTEGER *BS_BSREF,
SQLUDF_CHAR DateParam1[11],
SQLUDF_NULLIND *BS_BSREFNullInd,
SQLUDF_NULLIND *DateParam1NullInd,
SQLUDF_TRAIL_ARGS) ;
From the PHP we have got this error message:
Warning: odbc_execute(): SQL error: [IBM][CLI Driver][DB2/6000] SQL10010N
The specified library, "sbprogs1", was loaded, but the function
"S_GetProductList" could not be executed. , SQL state S1000 in SQLExecute
If after that I call the same proc from a C client prog I have this error
message:
SQLSTATE: HY010
Native Error Code: -99999
[IBM][CLI Driver] CLI0125E Function sequence error. SQLSTATE=HY010
What is wrong?
How can I get the proc running from a C or a PHP code?
What is the difference between the PARAMETER STYLE GENERAL AND DB2SQL?
Thank you for help. I'm really in a big trouble because the SQL code is very
complicated and it could be done only in a stored proc.
Gabor