?
Solved

Fetching records in ranges

Posted on 2005-03-28
4
Medium Priority
?
853 Views
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.
0
Comment
Question by:k_murli_krishna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 17

Author Comment

by:k_murli_krishna
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.
0
 
LVL 29

Accepted Solution

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

SET ROWCOUNT 10

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.

Leon
0
 
LVL 29

Expert Comment

by:leonstryker
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.

Leon
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 13647474
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

We are witnesses that everyone is saying that our children shouldn't "play" with a technology because it is dangerous. This article is going to prove that they are wrong.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

765 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