sqlplus/oracle database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • uhuckl1
    New Member
    • Jul 2007
    • 2

    sqlplus/oracle database

    How do i turn off the spool in my script if the query returns 0 records??
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You need to do that manually by

    SET SPOOL OFF

    Comment

    • uhuckl1
      New Member
      • Jul 2007
      • 2

      #3
      Originally posted by debasisdas
      You need to do that manually by

      SET SPOOL OFF

      currently in my script I have my spool info and then it runs my sql query and then I spool off and exit. But if the sql returns 0 records I don't want it to spool the output. Do I need to do a "count" sql statment of the records first before my acutal query and then use a variable before I run my sql to set on/off the spool based on the count of records? How would I write the syntax?

      thanks much for any direction...

      Comment

      Working...