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 -> Re: How to test procedure that has OUT params in SQLPlus?

Re: How to test procedure that has OUT params in SQLPlus?

From: ohaya <ohaya_at_cox.net>
Date: Tue, 21 Jun 2005 10:48:16 -0400
Message-ID: <42B828B0.16F66670@cox.net>

pobox002_at_bebub.com wrote:
>
> ohaya wrote:
> > Hi,
> >
> > I have created a procedure called decrypt_inmemory with following
> > parameters:
> >
> > key IN varchar2, data IN varchar2, cleardata OUT varchar2
> >
> > I was wondering how I can test execute this procedure from within
> > SQLPlus?
> >
> > How do I create a variable to receive the OUT parameter? And, how do I
> > display this variable after I test-execute the procedure?
> >
> > Thanks,
> > Jim
>
> You create a bind variable in SQL*Plus, look up the SQL*Plus
> Reference manual at http://docs.oracle.com for complete
> information.
>
> SQL> create or replace procedure p (s out varchar2
> 2 as
> 3 begin
> 4 s := 'output';
> 5 end;
> 6 /
>
> Procedure created.
>
> SQL> var s varchar2(100)
> SQL> exec p(:s)
>
> PL/SQL procedure successfully completed.
>
> SQL> print s
>
> S
> --------------------------------------------------
> output
>
> SQL>
>
> --
> MJB
Hi,

Thanks everybody for the responses!

I found the problem, at least with the calling. I had "UTL_RAW.CAST_TO_VARCHAR" in my procedure, whereas it should have been "UTL_RAW.CAST_TO_VARCHAR2"... Still not working correctly though. It's not decrypting correctly in-memory (it does work if I decrypt from data in a table :().

I'll post a separate msg with my code in a vew minutes.

Thanks again,
Jim Received on Tue Jun 21 2005 - 09:48:16 CDT

Original text of this message

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