Help - Search - Members - Calendar
Full Version: Fetching Data from a table in a loop from the range of row
Oracle DBA Forums > Oracle > Oracle Forum
Debo1345
Hi,
I have dcs_sku table .The record count is 50 thousand in that table.My requirement is to fech every row,create an xml out of it and post the data to some third party.
As the count is very huge,I can't select the entire record and do the operation at a time.
Can some one please suggest an way by which I will run the sql query in a loop,which will fetch 1st from rown 1 to row 1000,next 1001 to 2000,2000 no 'n' row...


I tried the below query:
select * from dcs_sku where rownum between 1 and 200...This gave me the 1st 200 rows and worked fine.
but the moment I changed the query to :
select * from dcs_sku where rownum between 201 and 300:::No result was coming up.

Please helppppppppppppppppppppppppppppppppppppppppppppppppp sad.gif sad.gif sad.gif sad.gif sad.gif I am very new to sql and this is a very very imp thing that I have to deliver to client asap.

So please helppppppppppppppppppppppppppppppppppppppppppppppp
Thanks
Debosree
burleson
Hi Debosree,

>> am very new to sql and this is a very very imp thing that I have to deliver to client asap.

First off, it's PL/SQL you need, not SQL!

Second, if you are not qualified to do your job, you need to tell your boss; it will only be a matter of time until you are exposed and it will be embarassing for you . . . .

********************************************
>> Fetching Data from a table in a loop from the range of row

Here is how to perform a nested loop jin in PL/SQL, what you are describing:

http://www.dba-oracle.com/t_plsql_join_tables_together.htm

For XML formatting, see here:

http://www.rampant-books.com/art_otn_vj_jain_11g_xml.htm

*******************************************
>> select * from dcs_sku where rownum between 201 and 300

You cannot chuk out data with rownum, you need a symbolic key instead.

If you want to learn Oracle fast, get the Easy Oracle pack:

http://www.rampant-books.com/menu_six_packs_bundles.htm#easy

Good Luck!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.