By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,504 Members | 1,884 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,504 IT Pros & Developers. It's quick & easy.

how to Spool results from SQL plus

P: n/a
I want to spool results from sql+ query to txt file.
txt file should have name like YYMMDD_anything.txt, where YYMMDD is actual
date.

Can somebody tell me how to write this?

Thanks in advance.
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You can do it like this:

VAR SPOOLFILENAME VARCHAR2(30)
COLUMN SPOOLFILENAME NEW_VALUE SPOOLFILENAME
SELECT to_char(sysdate, 'YYMMDD') || '_anything.txt' AS SPOOLFILENAME FROM DUAL;

SPOOLFILENAME
-------------------
040407_anything.txt

SPOOL &SPOOLFILENAME
....

"Mario Horvat" <ma**********@vz.htnet.hr> wrote in message news:<c5**********@sunce.iskon.hr>...
I want to spool results from sql+ query to txt file.
txt file should have name like YYMMDD_anything.txt, where YYMMDD is actual
date.

Can somebody tell me how to write this?

Thanks in advance.

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.