[VIEWED 5078
TIMES]
|
SAVE! for ease of future access.
|
|
|
Obie Trice
Please log in to subscribe to Obie Trice's postings.
Posted on 07-16-07 1:57
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Hello, this might be very basic question for you. I have a SQL statement that returns more than 150,000 tuples. I want to break the result to process. I mean I want to process the first 100,000 records first, then rest. Is there anyway I can break this by SAMPLING... I am using Oracle 8i PL/SQL.. Any help would be appriciated. TY
|
|
|
|
Obie Trice
Please log in to subscribe to Obie Trice's postings.
Posted on 07-16-07 3:43
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
I am kinda doing this within stored proc... something like if counter < 50000 then process... It's working, but i want to know if there is any way to embed code within SQL... might be dumb question
|
|
|
SupariThula
Please log in to subscribe to SupariThula's postings.
Posted on 07-16-07 3:47
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
yea that's a pretty dumb question
|
|
|
Bob Marley
Please log in to subscribe to Bob Marley's postings.
Posted on 07-16-07 9:21
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Is this for School or work related?
|
|
|
Obie Trice
Please log in to subscribe to Obie Trice's postings.
Posted on 07-16-07 9:43
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Bob, does it matter if it is school or work related? I had to generate an extract file, which got really long, so i was thinking of processing by breakin up. Anyways I already figured out, so chill out
|
|
|
cofi
Please log in to subscribe to cofi's postings.
Posted on 07-17-07 10:03
AM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Hey Orbie, Cna/ Do you use Perl script at all? Just a thought, U could call the stored proc within the perlscript and split the output file into multiple files.
|
|
|
xcopsgen
Please log in to subscribe to xcopsgen's postings.
Posted on 07-17-07 10:16
AM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
This might be a good idea. Since you have so much data why don't you break it apart. In a Stored Procedure , Create 3 temp table Create table #TempTable1 (col1 int,col 2 int,col3 money.....) then insert the data like 50000 in one temp table 1, another 50000 in temptable2 and so on. insert into #TempTable1 (col1, col2, col3,....) values (select col1, col2, col3, ...from OriginalTable where .....(i think here you might wanna counter < 50000) so now you break the data into 3 part. now all you need to do is selete from those temp tables and create a file. for select, use Select * from #TempTable1 this might work. let me know if there is any issue.. KEEP DIGGIN......Keep Programmin......
|
|
|
xbox
Please log in to subscribe to xbox's postings.
Posted on 07-17-07 10:25
AM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Obie Trice , how did u do it
|
|
|
Obie Trice
Please log in to subscribe to Obie Trice's postings.
Posted on 07-17-07 9:22
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
In Oracle, use ROWNUM column... WHERE ROWNUM < 50000 but you cannot use ROWNUM > 50000 in Oracle 8i or 9i. I am not sure... it didn't work for me So I used MINUS operator. Your logic could work too. For eg. SELECT * FROM TAB1 MINUS SELECT * FROM TAB1 WHERE ROWNUM < 50 I think in SQL server, they use key word LIMIT I think. BTW, how many of you work in Oracle? I know there are bunch of guys in SQL server.
|
|