PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Moving to a specific row
Date: Aug 31 2000 4:38PM

Jeff Greif writes:
 > For MS Sql Server (which supports the SQL construct TOP), you can use a
 > cursor and remember what the last row you've seen is, assuming that whatever
 > is ordering the rows is distinct in every row.  In the example stored
 > procedure below, the sort is by the varchar data CATEGORY, and there are two
 > cases -- the beginning of the result set, and arbitrary other locations
 > therein.  Dynamic SQL must be used (a string constructed and executed)
 > because this variety of SQL does not let you put a variable in the TOP
 > clause.  Our webservers call procedures like this using ct_sql.



Interesting.

What does the showplan look like for such a request? (ie - is it efficient?)

(and no, Sybase does not support this syntax)

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com