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

Bartolomeo Nicolotti bnicolotti at siapcn.it
Tue Feb 17 11:36:29 GMT 2009


Hi,

yeees, you were right again.

I've followed what's done here (I hadn't searched anything for java):

http://forums.systeminetwork.com/isnetforums/showthread.php?t=48619&page=2

and I've created a wrapped stored procedure to call the rpg program PROVA:

CREATE PROCEDURE PROVACSSP(INOUT input1 CHARACTER(2)) RESULT SETS 0
LANGUAGE SQL SPECIFIC PROVACSSP NOT DETERMINISTIC
MODIFIES SQL DATA CALL GIANLUCA/PROVAcs(input1)
Procedura PROVACSSP creata in VIAGGIFAP.

and it works.  see this source:
http://www.nabble.com/file/p22055413/helloODBCPrepStoredP.c
helloODBCPrepStoredP.c 

Now I'm trying to get the output value of the parameter, but if i set the
parameter as SQL_INPUT_OUTPUT in SQLBindParameters, with all the rest
unchanged I got:

bart at LxPC37:~/download/software/mono/src/test$ ./helloODBCPrepStoredP Dunkel
siapbn ******
Here1!!
Here2 param1 before AA!!
Error code: 1
Failure because: exec direct

and from the unixodbc.log:

[ODBC][14375][SQLPrepare.c][364]
		Exit:[SQL_SUCCESS]
[ODBC][14375][SQLExecute.c][183]
		Entry:            
			Statement = 0x80690e0
[ODBC][14375][SQLExecute.c][344]
		Exit:[SQL_SUCCESS_WITH_INFO]
		DIAG [22005] [IBM][iSeries Access ODBC Driver]Colonna 1: CWBNL0203 -
cwbcomsg.dll(93084) codeset=ISO-8859-1 path=/opt/ibm/iSeriesAccess/mri2932/

		DIAG [01004] [IBM][iSeries Access ODBC Driver]Troncamento a destra dei
dati stringa.

the message translated from italian back to english is Right truncation of
the string.

I've sniffed the net and it seems that the return value ('BB') arrives to my
machine.

Could you please have a look to see if there's some other parameter missing
or wrong?

many thanks

Best regards






Martin Evans-4 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...
>> 
>> Many thanks
>> 
>> Best regards. 
> 
> It would appear you are not alone:
> 
> http://forums.asp.net/p/961808/1558326.aspx
> 
> http://archive.midrange.com/rpg400-l/200204/msg00897.html
> 
> I found the comment about if you define a procedure with an input 
> parameter of char(8) you MUST call the procedure with char(8) interesting.
> 
> http://morewally.com/cs/blogs/wallym/archive/2006/06/27/87.aspx
> 
> This looked very promising:
> http://forums.systeminetwork.com/isnetforums/showthread.php?t=48619
> 
> Good Luck.
> 
> Martin
> -- 
> Martin J. Evans
> Easysoft Limited
> http://www.easysoft.com
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at mailman.unixodbc.org
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
> 
> 

-- 
View this message in context: http://www.nabble.com/inputOutput-parameter-problem-in-calling-stored-Procedure-tp22002537p22055413.html
Sent from the unixODBC - Support mailing list archive at Nabble.com.



More information about the unixODBC-support mailing list