If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > C stored Proc problem on AIX

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-17-04, 14:38
Gabor Gabor is offline
Registered User
 
Join Date: Jan 2004
Posts: 4
C stored Proc problem on AIX

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
Reply With Quote
  #2 (permalink)  
Old 01-21-04, 16:55
Gabor Gabor is offline
Registered User
 
Join Date: Jan 2004
Posts: 4
Is there no way to let it work?
I was searching the internet and the same errors have been reported for the newer versions (v7.2..) too.

Basically my question is hot to let run a C stored proc under AIX?
Which create proc statement, wich XLC compiler settings etc, what ever the version is?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On