Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Form a query using TOP and fetch next Rec
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Form a query using TOP and fetch next Rec

 Post Reply Post Reply
Author
ravi_zee View Drop Down
Newbie
Newbie


Joined: 05 December 2003
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote ravi_zee Quote  Post ReplyReply Direct Link To This Post Topic: Form a query using TOP and fetch next Rec
    Posted: 05 December 2003 at 5:48am

Hi,
I have an INI file, contans a field with "RestrictedRead =100"
I am reading the INI file in my Java code and getting this restrictd value and building a query dynamically for further processsing as...

sSQL = sSQL + " TOP " + getRestrictReadValue() + " ";

PROBLEM

If I have 10000 records to be processed, as of now it is reading only 100 records.But I want after 100 records completed it should fetch next 100 and continue till EOF(10000) records...

Can anyone help me how to succeed this and how to form a query for this scenario.

Matter very urgent

Cheers
Ravi

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 05 December 2003 at 7:26am
You cannot use top then, you use either a  SQL Side Cursor or you use ado paging. If you use top you only get your 100 records and you cannot go further. So depending on the architecture your are using, i would go with a cursor.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.