2 Replies Latest reply: Apr 26, 2013 12:27 AM by Nitesh. RSS

    simple sqlplus script doesn't seem to work

    k1ng87
      When I type in:

      C:\>sqlplus user/pass@OMP1 @CheckRowCount.sql
      it connects but I don't see any results, in the .sql file I have this:

      SELECT COUNT(*) as "rowcount" FROM dmsn.ds3r_1xrtt_voice_trigger;


      I've also tried this

      C:\>sqlplus user/pass@OMP1 SELECT COUNT(*) as "rowcount" FROM dmsn.ds3r_1xrtt_voice_trigger;
      but all I get is the sql*plus commands to use in the CMD window
        • 1. Re: simple sqlplus script doesn't seem to work
          k1ng87
          got it to work...forgot to put ";" in the sql file :-)

          I guess I should have expanded on the real reason i want to do this, I have a cmd that is as such right now:

          for /f "delims=" %%a in ('sqlplus user/pass@OMP1 @CheckRowCount.SQL') do set rowcount=%%a
          if %ROWCOUNT% GTR 0 (
          c:\Autobatch\Spotfire.Dxp.Automation.ClientJobSender.exe http://staom.sec.samsung.net:8070/spotfireautomation/JobExecutor.asmx c:\AutoBatch\backup\Trigger_Test.xml
          )
          EXIT


          but I don't get anything. All I get is a blank CMD window that opens
          • 2. Re: simple sqlplus script doesn't seem to work
            Nitesh.
            You have to use sql terminator or else use /(backslash) to execute the query or else search login.sql file in oracle home directory and make necessary changes so that next time it will execute the query without any terminator or backslash ..


            Regards..