Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2005
    Location
    Waukesha WI
    Posts
    78

    Unanswered: SQLPlus Bat for executing .SQL

    I'm fairly new to oracle and typically go into SQL Plus and do the following:

    Set Serveroutput on
    @c:\mydir\run_this_4.sql


    Is there a way I can do this via a batch file somehow?

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool


    Add the "set serverout..." command to the beginnig of script c:\mydir\run_this_4.sql and create a run_this_4.bat file with this command:
    Code:
    sqlplus <uid>/<pw>@<sid> @c:\mydir\run_this_4.sql
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Similar question was discussed just today here; perhaps you could use provided links to learn something new.

  4. #4
    Join Date
    Jun 2005
    Location
    Waukesha WI
    Posts
    78
    Thanks!
    I wouldn't have thought to look at "Spool File" in the search box for the thread - that thread is VERY helpful....thanks for that as well.

  5. #5
    Join Date
    May 2004
    Location
    BA [ARG]
    Posts
    137
    You can even return a number (like in C) to let the bat file know (using errorlevel) if it failed and why...

Posting Permissions

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