11 Replies Latest reply: Dec 21, 2012 12:01 AM by 981171 RSS

    Run a script from batch file

    Saaz Ena
      Hi All,

      I want to execute a SQL script that runs from a batch file.
      Lets say, I have loader.bat file. This .bat file connects to Oracle and wants
      to execute .sql file

      The content of loader.bat file is
      sqlplus 
      @C:\temp_val_id.sql
      At run time it ask to userid and password. I enter the username and password and then get connect to Oracle
      But the temp_val_id.sql file is not exectuted.

      The output is as below, but .sql file is not executed
      C:\>sqlplus
      
      SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 17:19:50 2012
      
      Copyright (c) 1982, 2010, Oracle.  All rights reserved.
      
      Enter user-name: utest_tt_senayat/password@silver3
      
      Connected to:
      Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
      With the Partitioning, OLAP, Data Mining and Real Application Testing options
      
      SQL>
      I am now trying a different method
      sqlplus 
      @@C:\temp_val_id.sql
      The output is the same as above. Not executing temp_val_id.sql

      Could someone please assist me,

      Thanks in advance
      Saaz