DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Quit SQLPLUS without exit

  1. #1
    Join Date
    Nov 2001
    Posts
    15
    SQL*Plus will exit without an exit if called this way:

    sqlplus user/password<<-EOF
    @script.sql
    EOF

    This works on UNIX. Can someone tell how to achive it on Dos/Windows?

    Basically, I donot have "exit" in sql script. When the script is run from sqlplus command, it should quit sqlplus session, without explicit call to exit.

    Pl help.

  2. #2
    Join Date
    Aug 2001
    Location
    Waterloo, On
    Posts
    547
    I cannot understand why you cannot add 'EXIT' to your script.

    Raminder Singh

    Oracle Certified DBA: Oracle 8i, 9i


    Mail me at raminderahluwalia@rediffmail.com.

  3. #3
    Join Date
    Sep 2001
    Location
    Makati, Philippines
    Posts
    857
    inside SCRIPT.SQL for example:
    insert into table1 values('dfdf',3343,33443);
    commit;
    exit

    in DOS or a batch file:
    sqlplus user/password@tnsname @SCRIPT.SQL

    your sqlplus had been executed from DOS.

    Hope this clears you.

  4. #4
    Join Date
    Nov 2001
    Posts
    15
    Actually I asked the wrong question. Please ignore my question on quitting sqlplus without exit in .sql file.

    The real question I have is this:

    What is the equivalent of following for Windows(or Dos):

    sqlplus user/password<<-EOF
    set define off;
    @script1.sql
    alter table x disable constraint fk_x;
    @script2.sql
    EOF

    The above syntax works on unix to run 2 sql scripts from sqlplus. I donot want to invoke sqlplus command twice separately.

    Pl help.



  5. #5
    Join Date
    Aug 2001
    Location
    Waterloo, On
    Posts
    547
    You can call the second script from the first one itself:

    In the first script, just type @@script2.sql at the end.

    Raminder Singh

    Oracle Certified DBA: Oracle 8i, 9i


    Mail me at raminderahluwalia@rediffmail.com.

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