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 -> Re: Passing Command Line Parms to Anonymous Procedures in an SQLPLUS script

Re: Passing Command Line Parms to Anonymous Procedures in an SQLPLUS script

From: Chris Leonard <chris_at_databaseguy.com>
Date: Tue, 14 May 2002 11:58:30 -0500
Message-ID: <YmbE8.48$TC5.35825@news.uswest.net>


Hello Don,

Use the substitution parameters &1, &2, and so on, inside your script. Documentation for this (in version 9i) is located in the SQL*Plus User's Guide and Reference, Chapter 3 (Manipulating Commands) in the section entitled "Passing Parameters through the START Command."

Hope this helps!
Chris

--
______________________________
Chris Leonard
MCSE, MCDBA, MCT, OCP, CIW
The Database Guy at PPI
http://www.propoint.com
Brainbench MVP for Oracle Admin
http://www.brainbench.com


"don hall" <dchall_at_wt.net> wrote in message news:3CDC9DF8.43BC4422_at_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 Tue May 14 2002 - 11:58:30 CDT

Original text of this message

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