Search code examples
c++oracle-pro-c

Pass a C++ method return to a Pro*C procedure


I am aware that in Pro*C is possible to pass to a procedure either a host variable or a String literal:

dbms_pipe.purge(:pipe_name);

dbms_pipe.purge('pipe_name');

Is it possible to pass a method return to a Pro*C procedure? The following call don't work:

dbms_pipe.purge(pipe_name.c_str());

Solution

  • Late answer, but still: First of all, Pro*C is quite dumb. It becomes even more dumb when switching from C to C++-Mode.

    Your second example does not challenge Pro*C at all, because the string constant is just part of your sql-statement. Your first example is just what it can do. You cannot access members of structs (But you can read in whole structs), call functions or whatever. The only way to deal with this is first to copy the result of the function call into a host-variable and then pass that to Pro*C. To find the Manual, try google search for "oracle pro*c developer guide". If you read it carefully, you will understand what you can do and what not...