RE: ESQL/C question
Posted in 2011
Sorry. Cut and Paste got in the way here, Art. We connect, prepare, allocate descriptors, then attempt to describe the descriptor.
This should work, right?
From: Art Kagel [mailto:art.kagel@gmail.com]
Sent: Friday, September 16, 2011 11:47 AM
To: Link, David A
Cc: informix-list@iiug.org
Subject: Re: ESQL/C question
Prepare first then describe.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com<http://www.advancedatatools.com>)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.
On Fri, Sep 16, 2011 at 12:16 PM, Link, David A <DALink@west.com<mailto:DALink@west.com>> wrote:
Version Info
Currently installed version: 3.50.UC8 - AIX 5.3
Hitting IBM Informix Dynamic Server Version 11.50.FC9 - AIX 5.3
I have a stored procedure:
CREATE PROCEDURE test_sp(PorderNum INT, PbatchID CHAR(20)) ...
We are attempting to use get descriptor to get the input parameters of the prepare statement:
EXEC SQL allocate descriptor 'stmt_params_in' with max 50;
EXEC SQL describe input :hv_stmt_alias using sql descriptor 'stmt_params_in';
EXEC SQL prepare :hv_stmt_alias from "execute procedure test_sp(?,?)";
...
hv_index = 1;
EXEC SQL get descriptor 'stmt_params_in' VALUE :hv_index :hv_type = TYPE, :hv_length = LENGTH, :hv_indicator = INDICATOR;
TRACE_LOG(TL_LEVEL1)("query_informix_statement: hv_index=%d hv_type=%d hv_length(%d)", hv_index, hv_type, hv_length);
hv_index = 2;
EXEC SQL get descriptor 'stmt_params_in' VALUE :hv_index :hv_type = TYPE, :hv_length = LENGTH, :hv_indicator = INDICATOR;
TRACE_LOG(TL_LEVEL1)("query_informix_statement: hv_index=%d hv_type=%d hv_length(%d)", hv_index, hv_type, hv_length);
The trace logs the following:
20110916120919139143 0,0,0 0,0,1,1 0.000000 query_informix_statement: hv_index=1 hv_type=2 hv_length(4)
20110916120919139164 0,0,0 0,0,1,1 0.000000 query_informix_statement: hv_index=2 hv_type=0 hv_length(0)
We are trying to figure out why the second argument is giving us a length of 0 as opposed to 20.
It should give us 20, correct? We have done this for standard SQL statements before just fine but this is the first time we have tried it with a store procedure.
Any help or directions to look?
TIA,
David
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org<mailto:Informix-list@iiug.org>
http://www.iiug.org/mailman/listinfo/informix-list