How do i turn off the spool in my script if the query returns 0 records??
sqlplus/oracle database
Collapse
X
-
-
Originally posted by debasisdasYou 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
Comment