Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4248812
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:18:43+00:00 2026-05-21T04:18:43+00:00

It’s simple – is there a way to use this lib to call stored

  • 0

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?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:18:44+00:00Added an answer on May 21, 2026 at 4:18 am

    As you note, Informix does not have ‘OUT’ parameters really; it returns values.

    In regular ESQL/C, you treat a list of output values symmetrically with a list of input values; I would expect to do the same with this code, therefore. Whatever technique you use to pass 2 arguments to the function is likely – but by no means guaranteed – to be how you get multiple returned values.

    In case of doubt, treat it as you would treat a SELECT statement that returns multiple rows. That is, do the analogues of:

     PREPARE s FROM "EXECUTE PROCEDURE test_out2(?)";
     DECLARE c CURSOR FOR s;
     OPEN c USING :input_value;
     while (sqlca.sqlcode == 0)
     {
         FETCH c INTO :out_value1, :out_value2;
         if (sqlca.sqlcode != 0)
             break;
         ...use values...
     }
     CLOSE c;
     FREE c;
     FREE s;
    

    I would recommend using ODBC over OIC++. The OIC++ interface is built on top of another library, DMI, which in turn is built on top of another library that accesses the DBMS – I forget whether it is ESQL/C or ODBC based, or one of the core libraries those are built on. Using unixODBC as your driver manager and an appropriate ODBC driver makes more sense to me than using OIC++.


    I’ve no real idea how that looks in OIC++; I’ve never used it, but only done some cursory maintenance of it.

    On the whole, you would be best advised not to use OIC++ for new work. Informix continues to distribute it for backwards compatibility rather than to encourage new use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.