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: "Pantera, Joseph F dot " <jpantera at gibsondunn dot com>
Subject: RE: displaying limited number of rows
Date: Mar 23 2001 5:44PM

Follow-on question along these lines (probably easier, although I know how
to do this in Oracle, but not Sybase)...  If I want to place a  column
number next to the output from a query indicating where I am at in the
output such as a list of names:

Column1:  Column2:
1         Name #1
2         Name #2
3         Name #3
.           .
.           .
.           .
N         Name #N

How do I do this in my query?
   
- Joe Pantera

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
Joseph F. Pantera      	Unix, Database & Network Systems Administrator
                        Gibson Dunn & Crutcher LLP
                        mail: jpantera@gibsondunn.com
                        phone:  (213) 229-7673
                   	fax:    (213) 229-6673
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-


-----Original Message-----
From: Michael Peppler [mailto:mpeppler@peppler.org]
Sent: Thursday, March 22, 2001 3:48 PM
To: SybPerl Discussion List
Subject: RE: displaying limited number of rows


AGaneshalingam writes:
 > Tks for your reply. Sorry, I didn't describe my question correctly. I
should
 > be able to display 50 rows at a given point. And continue this until I'm
 > done with displaying the all rows...

Ah.

I was wondering if this was what you were looking for...

Well - the short answer is that you can't do what you want (or at
least not easily)

However, you can program things so that you can get the behaviour you
want, by doing something like this:

set rowcount 50
select ... from ... 

In the script, remember the last row, and now, when the user wants the
next page, you do:

select ... from ... where {somekey} > {last value}

and so on.

This works well, but you of course need to have a reasonable key on
which to base your where clause...

Michael


 > 
 > -----Original Message-----
 > From: Leung, Patrick [mailto:patrick.leung@gs.com]
 > Sent: Thursday, March 22, 2001 2:15 PM
 > To: 'AGaneshalingam'
 > Subject: RE: displaying limited number of rows
 > 
 > 
 > have you tried sending the command
 > 
 > set rowcount 50 
 > 
 > to your sql server?
 > 
 > 
 > 
 > -----Original Message-----
 > From: AGaneshalingam [mailto:AGaneshalingam@globewireless.com]
 > Sent: Thursday, March 22, 2001 5:04 PM
 > To: SybPerl Discussion List
 > Subject: displaying limited number of rows
 > 
 > 
 > I'm trying to display ( on the web) 50 rows from a table that has almost
 > 10,000 rows of data....Is this possible with CT-Lib using SybPerl. Please
 > help me.
 > 
 > Tks
 > Anton
 > 

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


==============================================================================

This message may contain confidential and privileged information.  If it has been sent to you in error, please reply to advise the sender of the error and then immediately delete this message.
"PLEASE NOTE: Our e-mail and web site address has changed to gibsondunn.com"

==============================================================================