Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Passing Command Line Parms to Anonymous Procedures in an SQLPLUS script
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...Received on Tue May 14 2002 - 11:58:30 CDT
> 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
>
>
>
>