Fetching records in ranges

Posted on 2005-03-28
Medium Priority
Last Modified: 2008-03-06
We are finding problem in Sybase ASE 12.5.1 on AIX for having a numeric counter against the number of records selected from a table from which we will return records in ranges.

One way is @@identity, the other is a global temporary table & a third is to have id column on base table. All three are unacceptable. Is there any rownum/row_number like item in Sybase or any other way to achieve the desired. Please help out.
Question by:k_murli_krishna
  • 3
LVL 17

Author Comment

ID: 13644314
One thing I forgot. If we use global temp. table then for each invocation of same procedure will a separate table get created in RAM thus increasing burden
OR we can insert into #gtt with auto id column, do the desired select & delete all records when work is over. Will this obey transaction integrity.
LVL 29

Accepted Solution

leonstryker earned 300 total points
ID: 13644350
You can limit the number of items returned by setting the row count


This will return the first 10 items.  ther eis no way to return a range of data without using one of the ways you stated above.

LVL 29

Expert Comment

ID: 13644368
A global temp table will be destroyed then the procedure goes out of scope.  You may be better off by creating a a regular table and truncating it at teh end of each procedure.

LVL 29

Expert Comment

ID: 13647474

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft provides a rich set of technologies for High Availability and Disaster Recovery solutions.
Google webmaster tool or Google search console is an imperative tool for solving different website relevant issues. The amazing features of this tool greatly help to check the indexing and improve the visibility of the site.
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question