sqlplus nolog and parameter passing
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: sqlplus nolog and parameter passing

  1. #1
    Join Date
    Oct 2001
    Posts
    2

    Exclamation

    I am trying to write some instance and database creation scripts for an oracle instance I have on NT.

    I can create the instance without a problem. My problem comes when I try to call the script to create the database. I am using sqlplus /nolog because svrmgrl is going away in future releases of oracle. The root of the problem is that I am passing a single parameter to the sql script and the substitution is not taking place.

    Here is the command line

    sqlplus /nolog @run.sql instance1

    Here is a little bit of the code

    connect internal/
    startup nomount pfile=d:\oracle\admin\&1\pfile\init.ora
    .
    .
    .

    I have tried enclosing the pfile path in quotes, unquoting for the substitution variable. Nothing seems to work.

    I am using oracle 8.1.7. Does anyone have any thoughts?

    Thanks,

    John E.

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    what does

    sqlplus /nolog @run.sql instance1

    do?

    or you mean

    sqlplus /nolog
    @run.sql


    where run.sql should have the connection infos such as

    user/passwd@conn_string

  3. #3
    Join Date
    Oct 2001
    Posts
    2

    Talking

    I was trying to run an sql script from the NT command line, and pass that script a parameter. The sql script first line is the connect statement. It's second line is the startup command where I try to substitue a "Start" variable that is received as a parameter to the script.

    I think I have solved the problem with a work around. I have to set the oracle_sid environment variable anyway, so I have substituted that (%oracle_sid%) instead and it works.

    Thanks for responding!

    JDE

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