  | | | -none- | -none- 2007-09-03 - By Anju Bala
Back 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
<div>hi list,</div> <div> </div> <div>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:</div> <div> </div> <div>Table1 structure</div> <div>****************</div> <div>dealerid number;name varchar2(100);age number(3);sex char(1);</div> <div> </div> <div>table2 structure</div> <div>*******************</div> <div>feed_id number(10);feed_name varchar(20);feed_format clob;</div> <div> </div> <div>table3 structure</div> <div>******************</div> <div>feed_id number(10);column_name varchar2(100); -- to store the column name of table1</div> <div>column_position number(2); -- to store at what position column of table1 should be written</div> <div>application_id number(4); -- to store what application it is </div> <div> </div> <div>scenario1</div> <div>************</div> <div> </div> <div>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 : </div> <div> </div> <div>name,age,position</div> <div> </div> <div>Scenario2</div> <div>************</div> <div>if table3 doesnt contain any record for any column of table1 then that column should not be written.</div> <div> </div> <div> </div> <div>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. </div> <div> </div> <div>Please </div>
|
|
 |