Re: Stored procedure from OCI

From: Tim Smith <tssmith_at_netcom.com>
Date: 1995/06/13
Message-ID: <tssmithDA3DEG.HI2_at_netcom.com>#1/1


dccothr_at_pacbell.com (DCCothren) writes:
>I'm trying to execute a stored procedure in Oracle 7.1.4 on Solaris from a
>Macintosh application using OCI. The oexec call returns "ORA-00900:
>invalid
>SQL statement" which unfortunately makes sense. Any help will be appreciated.

Why does it unfortunately make sense? Was this a parse error (deferred parse, returned on the OEXEC call), or a true exec error?

Without intending any flames, this is the kind of query that is difficult to reply to. How exactly were you trying to call the SP? You have to embed the call in a PL/SQL anonymous block, so the SQL statement should look something like this (in C (you were using C, no?)):

char sql_stmt = "\
begin\
  pkg_name.proc_name(:x, :y);\
end;";

You would then parse (OPARSE) the SQL statement contained in the variable sql_stmt, bind input or output variables to the :x and :y placeholders using OBNDRV or OBNDRA, and execute the statement (OEXEC). That should work.

Look at Chapter 8 in the 2.x PL/SQL manual for specific examples. There's also a complete example in the 7.1 OCI manual.

When asking for help hereabouts, it's easier for people to respond with concrete advice if you are a little more specific about your problem. Show your code fragment, for example.

Good luck. Received on Tue Jun 13 1995 - 00:00:00 CEST

Original text of this message