Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*Plus: How can I write each record to a separate file
One way you could do this is with a SQL Plus script, that write another
SQLPlus script. Something like ...
col cmd1 format a72
spool myscript.sql
Select 'Spool emp_info'||ename||'.log' cmd1,
'Select * from emp where ename='''||ename||''';' cmd2
. . .
@myscript.sql
then you just tweak the formatting (eg. set pagesize 0 ...) This presumes that the employee name is unique. If not, you might want to use the primary key instead. This would work just as nicely if the employee name was made up of several columns - you would just concatenate them together...
HTH Received on Fri Sep 08 2006 - 10:12:24 CDT
![]() |
![]() |