This discussion is archived
2 Replies Latest reply: Apr 25, 2013 10:27 PM by Nitesh. RSS

simple sqlplus script doesn't seem to work

k1ng87 Newbie
Currently Being Moderated
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 Newbie
    Currently Being Moderated
    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. Explorer
    Currently Being Moderated
    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..

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points