Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Please help with Pro*C stored procedure question

Please help with Pro*C stored procedure question

From: <alexsokol_at_my-dejanews.com>
Date: Sat, 16 Jan 1999 18:33:03 GMT
Message-ID: <77qm0v$r3m$1@nnrp1.dejanews.com>


Below is a repost from comp.databases.oracle.misc of an article that failed to generate any responses. Any help would be greatly appreciated.


I have Pro*C code that works to execute a stored procedure that takes integer as IN arg, and places an SQL_CURSOR into a 2nd OUT argument. Its as simple as doing:

      SQL_CURSOR cursArg_out;
      .....
      EXEC SQL ALLOCATE :cursArg_out;
      EXEC SQL EXECUTE my_proc (:integerArg_in, :cursArg_out);

Now, I am trying to move from above to dynamic SQL to be able to avoid pro*c semantics check as well as to be able to supply stored procedure name run time. Here is the code that works with other types of IN/OUT vars but not with the SQL_CURSOR type:

      char sqlbuf[1024];
      char *sproc="Foo";
      sprintf (sqlbuf, "%s (:in_arg, :out_arg)");

  EXEC SQL PREPARE S FROM :sqlbuf;  EXEC SQL EXECUTE S USING :integerArg_in,
:xxx_out;  ^^^^^^^^^^^ As I said above works with other argument tyeps but
with cursor 2nd argument, I get:

>>>>

Pro*C/C++: Release 2.2.4.0.0 - Production on Tue Jan 12 12:53:33 1999

    EXEC SQL EXECUTE S USING :integerArg_in, :cursorArg_out;

...............................................1
(1) PCC-S-02319, expression type does not match usage
>>>>

What is the right (only?) way to use dynamic SQL on a stored procedure that takes a cursor?

Thanks,
Alex.

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Sat Jan 16 1999 - 12:33:03 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US