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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Writing text file from PL/SQL block

Re: Writing text file from PL/SQL block

From: Bill Ferguson <wbfergus_at_gmail.com>
Date: Tue, 4 Sep 2007 06:38:05 -0600
Message-ID: <4025610e0709040538x1585b65el98bc5e15ad734fff@mail.gmail.com>


Hi Anju,

I do somthing similar in my Apex Applications. I have two different "print" options, one creates a KML file on the server that the user can download and then plot locations on Google Earth, the other option merely loops through my 35 data tables to extract and format all of the information for a selected site and displays it as HTML.

Which option works best for you? The HTML version "may" only work if you have an application server, preferably with Apex installed in your database, I don't know.

Bill Ferguson

On 9/3/07, Anju Bala <oraclebala_at_gmail.com> wrote:
>
> hi list,
>
> I have a strange but interesting problem. I have three tables with below
> structure , I need to generate a text file using a PL/SQL block on the basis
> of below criteria:
>
> Table1 structure
> ****************
> dealerid number;name varchar2(100);age number(3);sex char(1);
>
> table2 structure
> *******************
> feed_id number(10);feed_name varchar(20);feed_format clob;
>
> table3 structure
> ******************
> feed_id number(10);column_name varchar2(100); -- to store the column name
> of table1
> column_position number(2); -- to store at what position column of table1
> should be written
> application_id number(4); -- to store what application it is
>
> scenario1
> ************
>
> i have to generate a text file from PL/SQL block wherein table1 column
> data should be written based on the position mentioned in table3. for
> example if dealerid is in 3 position,name is in 1 and age is in 2 position
> then my text file should contain data something like :
>
> name,age,position
>
> Scenario2
> ************
> if table3 doesnt contain any record for any column of table1 then that
> column should not be written.
>
>
> I know it can only be done using UTL_FILE package but dont know how to
> achieve it? I would really be obliged if anyone can provide with a sample
> block to achive this to me.
>
> Please
>

-- 
-- Bill Ferguson

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Sep 04 2007 - 07:38:05 CDT

Original text of this message

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