Home » SQL & PL/SQL » SQL & PL/SQL » spooling a select sql to multiple files based on number of records
spooling a select sql to multiple files based on number of records [message #8763] Wed, 24 September 2003 10:17 Go to next message
WALID
Messages: 31
Registered: August 2002
Member
Hi,
What is the best way to handle spooling a select sql results into multiple files based on the number of records?
any help is appreciated.
Re: spooling a select sql to multiple files based on number of records [message #8764 is a reply to message #8763] Wed, 24 September 2003 10:29 Go to previous messageGo to next message
Gerald
Messages: 54
Registered: January 2001
Member
Dear,
you can add a counter inside your PL/SQL and do:

spool in file-0-4999.txt
while counter < 5 000
Do SQL
counter<-counter+1
while counter < 10 000
spool off
spool in file-5000-10000.txt
Do SQL
counter<-counter+1
...
ect

do you get it ?
Take care
Gerald
Re: spooling a select sql to multiple files based on number of records [message #8766 is a reply to message #8764] Wed, 24 September 2003 10:52 Go to previous message
WALID
Messages: 31
Registered: August 2002
Member
no I don't get the logic. can you be more specific. The main issue is that with this logic, I will not be able to know how many files I need although I know the number of rows that I need to spool.
Previous Topic: DBLINKS with 8i and 9i
Next Topic: dynamic sql while updating
Goto Forum:
  


Current Time: Thu Apr 25 00:00:36 CDT 2024