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: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 21 Jun 2005 10:12:24 -0700
Message-ID: <1119373951.253533@yasure>


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

In addition to the SQL*Plus methods others have posted you can always wrap a stored procedure in a function.

CREATE OR REPLACE FUNCTION test_proc (key_string IN varchar2, encrypted_string IN varchar2) RETURN VARCHAR2 AS

BEGIN
   decrypt_password_inmemory(key_string, encrypted_string, decrypted);    RETURN decrypted;
END test_proc;
/

SELECT test_proc(val1, val2) FROM dual;

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Tue Jun 21 2005 - 12:12:24 CDT

Original text of this message

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