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

Home -> Community -> Usenet -> c.d.o.misc -> Passing Command Line Parms to Anonymous Procedures in an SQLPLUS script

Passing Command Line Parms to Anonymous Procedures in an SQLPLUS script

From: don hall <dchall_at_wt.net>
Date: Fri, 10 May 2002 23:28:41 -0500
Message-ID: <3CDC9DF8.43BC4422@wt.net>


Can this be done? The documentation is not clear.

Example

SQL > @my_script.sql parm1 parm2

my_script.sql

set serveroutput on

declare

vparm1 varchar2(20) := parm1 -- initalize a variable with the parameter from command line
vparm2 varchar2(20) := parm2 -- initalize a variable with the parameter from command line

--
begin

dbms_output.put_line('First paramater is '||vparm1);
dbms_output.put_line('Second paramater is '||vparm2);

end;

Thanks,

Don Hall
Received on Fri May 10 2002 - 23:28:41 CDT

Original text of this message

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