Spool to multiple files
423155Jun 10 2004 — edited Jun 10 2004Hello,
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