Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    54

    Unanswered: how to query with index range

    Hi,

    I have the following query.

    SELECT PUTDATE, PUTTIME, MSGID, MSGTYPE FROM DB2A.MQMD WHERE TSTAMP BETWEEN '2004-04-20-10.00.00' AND '2004-04
    -20-10.20.59'

    I wanted to retrieve 10 records at a time bcz it will return huge ResultSet.

    How will be the query to retrieve the data with index range?

    I appreciate ur help.

    Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Germany
    Posts
    62
    If you only want to retrieve 10 rows, you can use the clause FETCH FIRST 10 ROWS ONLY. Is that what you meant?

  3. #3
    Join Date
    Mar 2004
    Posts
    54
    No, i will pass first and last index ranges.
    Let me put this way.
    if my query can return 200 records, i should retrieve 50 records at a time instead of retrieving all the 200 records at a time.

    This will help me if my query has chances to return 100,000 records.
    So in that scenario, my application performance drastically come down.
    So to aviod that first i will get only first 50 records first and show it, when user clicks next button i will get next 50 records from DB and display and so on.

    I guess you might have understood my requirement.

    Thanks

  4. #4
    Join Date
    Mar 2004
    Posts
    54
    may we can do it using explicit cursor. I need help in this direction.

    Thanks

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Search for the words Pagination and/or Naveen in

    www7b.boulder.ibm.com/dmdd

    HTH

    Sathyaram

    Originally posted by manth
    may we can do it using explicit cursor. I need help in this direction.

    Thanks
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  6. #6
    Join Date
    Mar 2004
    Posts
    54
    Satyaram,
    It's useful information for me. I appreciate it. It's nice link. This is what i am looking for.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •