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
ashwin_tampa
Messages: 40
Registered: October 2005
Member
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?

SCENARIO
========
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:

'C:\test\20070910_org_1.txt'
'C:\test\20070910_org_2.txt'




Thanking you


Re: SQL*PLUS command [message #266367 is a reply to message #266360] Mon, 10 September 2007 11:51 Go to previous message
BlackSwan
Messages: 26766
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: Logon trigger on schema
Goto Forum:
  


Current Time: Thu Feb 13 22:34:27 CST 2025