ESQL/C question
Posted in 2011
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