Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*Plus: How can I write each record to a separate file

Re: SQL*Plus: How can I write each record to a separate file

From: G Quesnel <dbaguy_ott_at_yahoo.com>
Date: 8 Sep 2006 08:12:24 -0700
Message-ID: <1157728344.090697.200480@b28g2000cwb.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US