[unixODBC-support] inputOutput parameter problem in calling stored Procedure

Martin Evans martin.evans at easysoft.com
Tue Feb 17 11:52:55 GMT 2009


Glad to hear you are making some progress.

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com

Bartolomeo Nicolotti wrote:
> Hi,
> 
> I've done some further test and it's needed to leave the space for the
> trailing '\0', I have a two character inout parameter, I must say the buffer
> has space for 2char+trailing '\0'. 
> 
> this program works: 
> http://www.nabble.com/file/p22055501/helloODBCPrepStoredP.c
> helloODBCPrepStoredP.c 
> 
> bart at LxPC37:~/download/software/mono/src/test$ gcc -o helloODBCPrepStoredP
> -lodbc helloODBCPrepStoredP.c
> bart at LxPC37:~/download/software/mono/src/test$ ./helloODBCPrepStoredP Dunkel
> siapbn siapbn75
> Here1!!
> Here2 param1 before AA!!
> Here3 param1 after BB!!
> Success!
> 
> Now I'm going "back to the future" with c#/mono
> 
> Many thanks
> 
> Best regards.
> 
> 
> 
> Bartolomeo Nicolotti wrote:
>> Hi,
>>
>> I've moved the SQLBindparameter before the SQLPrepare, see here: 
>> http://www.nabble.com/file/p22053730/helloODBCPrepStoredP.c
>> helloODBCPrepStoredP.c 
>>
>> but I got the same result.
>>
>> [ODBC][12133][SQLPrepare.c][189]
>> 		Entry:            
>> 			Statement = 0x80690e0            
>> 			SQL = [CALL GIANLUCA.PROVACs(?)][length = 24 (SQL_NTS)]
>> [ODBC][12133][SQLPrepare.c][364]
>> 		Exit:[SQL_ERROR]
>> 		DIAG [S0002] [IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0204 - PROVACS
>> in GIANLUCA di tipo *N non trovato.
>>
>> I'll ask IBM. if I can't do this I'll have to use windows, sigh....
>>
>> Many many thanks
>>
>> Best regards
>>
>>
>> Nick Gorham-2 wrote:
>>> Bartolomeo Nicolotti wrote:
>>>
>>>> Hi,
>>>>
>>>> I've tried with a C program 
>>>> http://www.nabble.com/file/p22053497/helloODBCPrepStoredP.c
>>>> helloODBCPrepStoredP.c  that calls a stored procedure (better and RPG
>>>> program on iseries) and I got:
>>>>
>>>> bart at LxPC37:~/download/software/mono/src/test$ ./helloODBCPrepStoredP
> Dunkel
>>>> siapbn siapbn75
>>>> Error code: -1
>>>> Failure because: prepare:
>>>>
>>>> and from unixodbc log.
>>>>
>>>> [ODBC][11389][SQLPrepare.c][189]
>>>> 		Entry:            
>>>> 			Statement = 0x80690e0            
>>>> 			SQL = [CALL GIANLUCA.PROVACS(?)][length = 24 (SQL_NTS)]
>>>> [ODBC][11389][SQLPrepare.c][364]
>>>> 		Exit:[SQL_ERROR]
>>>> 		DIAG [S0002] [IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0204 -
> PROVACS
>>>> in GIANLUCA di tipo *N non trovato.
>>>>
>>>> The message, is the same as with mono, and in the iseries slang means
> that
>>>> it searches for a procedure with no parameters (*N), and it doesn't find
> it
>>>> as the procedure PROVACS has been built for test purpose only, has 1
>>>> parameter of type char and it's not overloaded.
>>>>
>>>> I think that the driver lacks the possibility of doing prepared
> statements
>>>> that call stored procedures, or there's some other way of doing this.
>>>> My pc is 32 bit, the iseries system uses ebcdic and the number of bits on
>>>> iseries is not so easy to know, I think 48bits, yes the iseries is a
> strange
>>>> world...
>>>>  
>>>>
>>> Just for completnes, move the SQLBindParameter to before the SQLPrepare. 
>>> But as we have said, its the driver that has the problem. I suspect 
>>> binding first will fix the problem, or passing the variable in place. 
>>> But neither help you with mono.
>>>
>>> -- 
>>> Nick
>>> _______________________________________________
>>> unixODBC-support mailing list
>>> unixODBC-support at mailman.unixodbc.org
>>> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
>>>
>>>
>>
> 


More information about the unixODBC-support mailing list