Command Line Arguments to PL/SQL Block
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Command Line Arguments to PL/SQL Block

  1. #1
    Join Date
    Nov 2000
    Posts
    48

    Question

    Hi ,

    Can we pass command line arguments to a PL/SQL block which is written in .SQL file?

    Thanks a lot!

    Rajesh

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,966
    Is this what you mean?


    undefine mystring

    begin
    select &&mystring from dual;
    end;
    /

  3. #3
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,448
    yes, just use &1, &2 etc

    &1 would be the first argument

    for example if you have your pl/sql block in a *.sql you could do

    @xxx.sql myarg1 myarg2

    &1 and &2 will take care of rest

    if you want to store &1 and &2 during the session you should use &&1, &&2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width