It's simple - is there a way to use this lib to call stored procedure or function, that returns more than one result? I know about the ITRoutingManager
, but it seems to return just one value..
In details, here's what I mean:
CREATE FUNCTION test_out1( pin INT )
RETURNING INT;
DEFINE param INT;
LET param = 321;
RETURN param;
END FUNCTION;
Returns 321
, I can get the value with ITValue
and ITConversions
. So this is fine. But the following is not:
CREATE FUNCTION test_out2( pin INT )
RETURNING INT, INT;
DEFINE param INT;
LET param = 321;
DEFINE param2 INT;
LET param2 = 123;
RETURN param, param2;
END FUNCTION;
When I do routine.GetRoutine( "function test_out2( int )" )
, it's bound fine, so no problem with that. But see this:
std::cout << "Result type: " << routine.ResultType()->Name() IsRow() ? "row, " : ", " )
<< (routine.ResultType()->IsCollection() ? "collection, " : ", " )
<< routine.ResultType()->Quality() << "\n\n";
prints integer, , , null
, note the integer.. Why is integer, not row, for example. And how to get the 2 values, returned by the function? Another interesting fact - the returned value is 0(when I convert it to int
, using the ITConversions
class), not 123, nor 321..
There have to be a way. This is a special library, written for Informix servers, by Informix developers and it would be strange, if this is not possible.
The same for functions, but I guess it's the same there.
NOTE: there's no such thing as out parameters in the common case, for informix procedures/functions (Informix: procedure with output parameters?)