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: Andrew Armstrong <andrew at qdebit dot com>
Subject: Re: Moving to a specific row
Date: Aug 31 2000 3:17PM

I agree with you. From whaT I have seen of the open client api there is no way
to do this besides looping through and fetching the required number of rows. I
would bet that its is implemented in this way but have not delved into the
source code.

Quoting Michael Peppler :

> Andrew Armstrong writes:
>  > All I want to do is mimic the following PHP function in perl
>  > 
>  > 
>  > 	int sybase_data_seek (int result_identifier, int row_number)
>  > 
>  > 	Returns: true on success, false on failure 
>  > 
>  > 	sybase_data_seek() moves the internal row pointer of the Sybase 
>  > 	result associated with the specified result identifier to pointer 
>  > 	to the specifyed row number. The next call to sybase_fetch_row() 
>  > 	would return that row. 
>  > 
>  > I can write my own function to do this but ff there is a way to do
> this in
>  > Sybase::CTlib I would love to know how.
> 
> I'd be interested in seeing the C code for that PHP function. AFAIK
> the only way to do this is to actually fetch the rows...
> 
> Michael
> 
> 
>  > 
>  > Quoting Michael Peppler :
>  > 
>  > > Andrew Armstrong writes:
>  > >  > I routinely have to report large numbers of database table rows
> to a
>  > > web page
>  > >  > and was having a problem limiting the number of rows I display
> using
>  > > the
>  > >  > standard CTlib methods. I can use set rowcount xxxx but this
> only
>  > > limits the
>  > >  > resultset to the first xxxx rows. I want to be able to move the
>  > > resultset to a
>  > >  > row that I choose. I can do this in PHP and was wondering how
> the
>  > > best way to do
>  > >  > this in Perl would be.
>  > >  > 
>  > >  > The only solution that i have found is to call ct_fetch() xxxx
> times
>  > > and ignore
>  > >  > the results or to use ct_sql to move the results into an array
> and
>  > > start at the
>  > >  > xxxx element. Neither of these seem very good for system
> performace.
>  > >  > 
>  > > 
>  > > I don't see how PHP could do this any better than perl. It is
> limited
>  > > by what Sybase understands, and in this particular case it is
> limited
>  > > by the way SQL works.
>  > > 
>  > > As SQL is set-based you can't say "get me rows x through y".
> Instead
>  > > you have to use an appropriately constructed where clause that will
>  > > give you the next x rows.
>  > > 
>  > > 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
>  > > 
>  > 
>  > 
>  > 
>  >
>
-------------------------------------------------------------------------------
>  > Andrew Armstrong                                         
> andrew@qdebit.com
>  > Chief E-Commerce Engineer                                
> http://www.qdebit.com
>  > AMIS , LLC.
>  > 
> 
> -- 
> 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
> 



-------------------------------------------------------------------------------
Andrew Armstrong                                          andrew@qdebit.com
Chief E-Commerce Engineer                                 http://www.qdebit.com
AMIS , LLC.