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

Home -> Community -> Usenet -> c.d.o.tools -> Re: generating a text file of a table

Re: generating a text file of a table

From: sw <swilliam_at_flash.net>
Date: Fri, 15 Dec 2000 19:57:27 GMT
Message-ID: <HIu_5.8727$bw.829959@news.flash.net>

Another approach is to create a stored procedure and use the UTL_FILE package. I have pasted some sample code below. (Given this addition to init.ora [utl_file_dir = D:\oraFiles]). The code is also available at my website ( http://home.flash.net/~swilliam/PLunloadSQL.txt ). I am curios as to what all of your thoughts are on this approach. -sw

SAMPLE

CREATE OR REPLACE PROCEDURE unloadStudent AS -- Declare the variables

 v_tempRecord c_student%ROWTYPE;

BEGIN

   v_detailBuffer :=
v_tempRecord.STUDENT_ID||','||v_tempRecord.SALUTATION||','||v_tempRecord.FIR ST_NAME||','|| v_tempRecord.LAST_NAME||','||v_tempRecord.STREET_ADDRESS||','||v_tempRecord. ZIP||','|| v_tempRecord.PHONE||','||v_tempRecord.EMPLOYER||','||v_tempRecord.CREATE_Dt;   END LOOP; Received on Fri Dec 15 2000 - 13:57:27 CST

Original text of this message

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