Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Spool to multiple files

423155Jun 10 2004 — edited Jun 10 2004
Hello,

I have a table containing order information for all our customers.

I need to generate a file that lists all orders, for each one of our customers. Each file will be named like so, Account1.txt, Account2.txt, etc.

I can do this individually by carrying out the following:-

SPOOL account1.txt
select * from orders where account_no = 1;
SPOOL OFF

However, we have over a thousand customers, so I don't want to have to do the above script a thousand times.

Is there a way that I can loop through the different accounts and spool to different file names?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2004
Added on Jun 10 2004
11 comments
1,644 views