Home » Other » Client Tools » SQL*PLUS - spool output to file.
SQL*PLUS - spool output to file. [message #329475] Wed, 25 June 2008 09:14 Go to next message
ashwin_tampa
Messages: 40
Registered: October 2005
Member
Hello guys,

I have a problem on SQL*PLUS spool output.

If my SELECT statement does not return any data
I don't want to spool output into file. I dont want to
generate empty file. Is it possible?

Here is my case :

SET SERVEROUTPUT ON SIZE 1000000

SPOOL C:\TEST.TXT

SELECT * FROM T1
WHERE T1.ID IS NOT NULL;

SPOOL OFF;



So if above statement do not returns any data
I do not want to generate empty file 'C:\TEST.TXT'.
Is there any way to stop this?

Appreciate your insights!


Re: SQL*PLUS - spool output to file. [message #329494 is a reply to message #329475] Wed, 25 June 2008 10:31 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
No as soon as you use "spool" you create the file.

Regards
Michel
Re: SQL*PLUS - spool output to file. [message #329526 is a reply to message #329494] Wed, 25 June 2008 12:42 Go to previous message
ashwin_tampa
Messages: 40
Registered: October 2005
Member

Thank you Michel for your reply.

I have made a workaround to delete
0 kb files for those files which is being
generated in case of NO_DATA_FOUND.

Thank you again.
Previous Topic: ORA-12154; TNS:could not resolve the connect identifier specified
Next Topic: How to configure URL iSQL*Plus DBA on 10G window Platform
Goto Forum:
  


Current Time: Sun Dec 22 15:20:15 CST 2024