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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Call store procedulre in Pro C !

Re: Call store procedulre in Pro C !

From: Mark J. Bobak <mark_at_bobak.net>
Date: 2000/04/09
Message-ID: <AN4I4.3531$CA2.324556@typhoon.mw.mediaone.net>#1/1

Try an anonymous PL/SQL block in in your Pro*C code. EXEC SQL EXECUTE
BEGIN
     myProdecure(:i);
EXCEPTION
  WHEN OTHERS THEN
     <do-whatever>
END;
END-EXEC; Note also, if it's a Procedure and NOT a function, it doesn't return anything to the calling program.

For a function, use something like:

:ret_val := myFunction(:i);

in place of the myProcedure() line above.

-Mark

In article <8codd4$f0g$1_at_nnrp1.deja.com>, Eric Chow <eric138_at_yahoo.com> wrote:
> Hi,
>
> Would you please to give me a simple example to call store procedure in
> Pro *C/C++ ?
>
> Since I try to use "EXEC SQL CALL myProcedure(:i) INTO :x;", it failed.
> The error message as following :
>
> EXEC SQL CALL myProcedure(:i) into :x;
> ..1
> PLS-S-00201, identifier 'MYPROCEDURE' must be declared
> Error at line 43, column 3 in file demo.pc
> EXEC SQL CALL myProcedure(:i) into :x;
> ..1
> PLS-S-00000, Statement ignored
> Semantic error at line 43, column 3, file demo.pc:
> EXEC SQL CALL myProcedure(:i) into :x;
> ..1
> PCC-S-02346, PL/SQL found semantic errors
> *** Error code 1
>
>
>
>
> The following is my simple source code :
>
> .....
>
> EXEC SQL BEGIN DECLARE SECTION;
> int i, x;
> EXEC SQL END DECLARE SECTION;
>
> i = 100;
>
> EXEC SQL CALL myProcedure(:i) into :x;
>
> cout << "Store Procesure : "<< x << endl;
>
> .....
>
>
>
> Please tell me why ?
>
>
> Regards,
> Eric
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sun Apr 09 2000 - 00:00:00 CDT

Original text of this message

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