Home » SQL & PL/SQL » SQL & PL/SQL » SQL*PLUS command
SQL*PLUS command [message #266360] Mon, 10 September 2007 11:41 Go to next message
Messages: 40
Registered: October 2005
Hi guys,

Could someone help here ?

requirement is : SQL*PLUS command.

I know the following way it is not doable from SQL*Plus
but is there any other way to achieve same from SQL*Plus?

Is it possible to generate files using spool option assiging
a column value as file name as per following scenario ?

SPOOL C:\'to_char(sysdate,'YYYYMMDD'||'_'||org_name||'.txt'  <--- is it possible?

select id,name,org_name
from test_org;

spool off

---data inside table is 

id      name       org_name
---- ----------  -------------
1     abc         org_1
2     def         org_1
3     ghi         org_2
4     jkl         org_2

want to generate each file for each org_name separately on a given path.

So above will generated two file like:


Thanking you

Re: SQL*PLUS command [message #266367 is a reply to message #266360] Mon, 10 September 2007 11:51 Go to previous message
Messages: 25574
Registered: January 2009
Location: SoCal
Senior Member
You OBVIOUSLY did NOT search this board for your FAQ before posting.
Previous Topic: External tables -alter table
Next Topic: Privileges create any table
Goto Forum:

Current Time: Sun Aug 20 23:50:13 CDT 2017

Total time taken to generate the page: 0.00820 seconds