Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Location
    Cergy
    Posts
    65

    Unanswered: How to pass an parameter to a PL/SQL script ?

    I want to pass a parameter (directory) from the OS to the PL/SQL script using


    For Windows I run the script using the foollowing DOS command:
    sqlplus user@sydney/password @"c:\0pj\script\a.sql" c:\mydir

    c:\mydir is the parameter I want to transfer to a PL/SQL variable to use it in my script.


    Thanks

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    Will this work?

    sqlplus user@sydney/password @c:\0pj\script\a.sql 'c:\mydir'

    Gregg

  3. #3
    Join Date
    Jan 2004
    Location
    Cergy
    Posts
    65
    but what is the PL/SQL syntax in the script ?

  4. #4
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    At the beginning of the script

    define directory_name = &1;
    ...
    ...
    select abc from table where column = '&directory_name'

    Gregg

Posting Permissions

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