How to extract 3 different select statements into flat file through dump_csv utl funtion.........(in one pstored procedure)....oracle sql to flat files

Hi,

I am extracting data from oracle (sql) into flat files(interface).......so i am writing sequel code in one select statement....from many tables and with joins in where clause....and i am assigning this sequel code to dump_csv utl function....to dump into flat file....in unix.....
So my question is i have multiple records...to extract....that means i have 3 different sequel code with select statement..(3 diff. select statements).....I have to write a stored procedure and i wanna put these 3 select statements(sequel codes)...
how can we do it......plz help me....these 3 select statements shoulbe dumped into flat files....(for trailer record)...
in the flat_file it should be printed....horizontally...

ex:-1.   l_rows:=dump_csv('select stamtement...............from tables...where ...joins'),'',
          '/source/oradata/dev/utl_file','  extract.dat');
           dbms_output.put_line(to_char(l_rows) || 'rows extracted to ascii file');
  l

   Like this i have 3 different select statements...so from these 3 select statements out put should come in the one like horizontally...side by side.........


    that means this is needed for trailer record....

   i wanna put 3 diiferent select statemts...in one stored procedure....and dump into flat files....how?

please tell me ...............urgent..... this is required ...for trailer record.....

for accout totals and grand totals......all should come in oneline as output...in (horizantally) from above 3 diff select statemts...

ex:-   rec_type             record count                 amount totals

           100                       30000                          $  10,0000......................

RAMAN1234Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RAMAN1234Author Commented:
data extraction from oracle(sql) into flat files....

3 different sequel codes(select statements) should be written in one stored procedure.........using DUMP_CSV FUNCTION.




HOW PLZ ANSWER..........VERY URGENT......WITH CODE....

Thanks,
0
alpmoonCommented:
I suggest to create three temporary tables and select the result set from these temp tables. But, if you need to run it in Oracle, you should send the question in Oracle area, not Sybase.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Sybase Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.