dbTalk Databases Forums  

Asa7 paging

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Asa7 paging in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ZeroCool
 
Posts: n/a

Default Asa7 paging - 10-12-2009 , 02:42 AM






Under ASA9 as far as I know, a sain paging technic could be
already achieved through the use of SELECT TOP n START AT p
[col]+ or window functions..

Unfortunately ASA7 lacks to this feature, and I can't figure
out any other way to handle it properly !

Any Indications on how to go about it ?

Thanks,

Reply With Quote
  #2  
Old   
ZeroCool
 
Posts: n/a

Default Re: Asa7 paging - 10-13-2009 , 03:25 AM






Quote:
Under ASA9 as far as I know, a sain paging technic could
be already achieved through the use of SELECT TOP n START
AT p [col]+ or window functions..

Unfortunately ASA7 lacks to this feature, and I can't
figure out any other way to handle it properly !

Any Indications on how to go about it ?

Thanks,
Let me guess ! I'm so fucked up ?

Reply With Quote
  #3  
Old   
Volker Barth
 
Posts: n/a

Default Re: Asa7 paging - 10-13-2009 , 04:54 AM



As ASA 7 does not support the START AT clause, I guess you basically
have to "number" your resultset and then use a WHERE clause to filter
the fitting numbers per page.

There's the number() function is ASA7 that might be useful; however, as
to ASA8 docs, number() should only be used in SELECT lists (and not in
WHERE clauses) as it might lead to inpredicable results, and obviously a
paging would need the numbers in the WHERE clause.

Therefore I'm not sure if the following would work in ASA 7:

select rowNo, col1, col2, .., colN
from
(select number(*) as rowNo, col1, col2, .., colN
from MyTable
order by col1) S
where rowNo between <p> and <p + n>
order by rowNo;

Note, that in order to filter the numbered rows, the number() function
must be used in a derived table (you have to number *before* the
filtering is done).


Other approaches to number rows, when no OLAP or START AT support is
available, include to join a result set with itself and by that counting
the results.

Some examples for MS SQL 2000 can be found here and should work with
ASA7, too:
"How to dynamically number rows in a SELECT Transact-SQL statement"
http://support.microsoft.com/default...b;en-us;186133

HTH
Volker





ZeroCool wrote:
Quote:
Under ASA9 as far as I know, a sain paging technic could
be already achieved through the use of SELECT TOP n START
AT p [col]+ or window functions..

Unfortunately ASA7 lacks to this feature, and I can't
figure out any other way to handle it properly !

Any Indications on how to go about it ?

Thanks,

Let me guess ! I'm so fucked up ?

Reply With Quote
  #4  
Old   
Breck Carter [TeamSybase]
 
Posts: n/a

Default Re: Asa7 paging - 10-13-2009 , 07:32 AM



October 12 was a holiday for all the SQL Anywhere engineers, and most
folks in the USA and Canada, and this is a volunteer forum...

So please be impatient, and PLEASE KEEP THE PROFANITY TO YOURSELF.

Breck

On 13 Oct 2009 01:25:02 -0700, ZeroCool wrote:

Quote:
Under ASA9 as far as I know, a sain paging technic could
be already achieved through the use of SELECT TOP n START
AT p [col]+ or window functions..

Unfortunately ASA7 lacks to this feature, and I can't
figure out any other way to handle it properly !

Any Indications on how to go about it ?

Thanks,

Let me guess ! I'm so fucked up ?
--
Breck Carter http://sqlanywhere.blogspot.com/

RisingRoad SQL Anywhere and MobiLink Professional Services
breck.carter (AT) risingroad (DOT) com

Reply With Quote
  #5  
Old   
Volker Barth
 
Posts: n/a

Default Re: Asa7 paging - 10-13-2009 , 09:41 AM



Breck Carter [TeamSybase] wrote:
Quote:
So please be impatient...

Breck
I'm sure that will make its way into "Breck's Famous Quotes"

Volker

Reply With Quote
  #6  
Old   
Breck Carter [TeamSybase]
 
Posts: n/a

Default Re: Asa7 paging - 10-13-2009 , 12:53 PM



Yeah, I meant to change the imperious "don't be impatient" into the
kindler gentler "please be patient", got the dyslexic version




On 13 Oct 2009 07:41:35 -0700, Volker Barth
<No_VBarth (AT) Spam_GLOBAL-FINANZ (DOT) de> wrote:

Quote:
Breck Carter [TeamSybase] wrote:
So please be impatient...

Breck

I'm sure that will make its way into "Breck's Famous Quotes"

Volker
--
Breck Carter http://sqlanywhere.blogspot.com/

RisingRoad SQL Anywhere and MobiLink Professional Services
breck.carter (AT) risingroad (DOT) com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.