Re: Paging a SQL result...
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 53238
interpreted = N
texte = Why not just use the the LIMIT and offset?[!] ----------------- SET THE MAX # TO BE FOUND ------------------ [/!][mathshow=f]maxfound=5[/math][!] ------------------ CHECK TO SEE IF FIRST TIME VIEWING PAGE ------------------- [/!][showif [offset]=[raw][offset][/raw]][text]offset=0[/text][math show=f]prev=-[maxfound][/math][math show=f]next=+[maxfound][/math][/showif][showif [offset]!0][math show=f]prev=[offset]-[maxfound][/math][math show=f]next=[offset]+[maxfound][/math][/showif][!] -------------------------- THEN SET SELECT STATEMENT -------------------------- [/!]select * from FIELD ORDER BY 1 DESC LIMIT [offset],[maxfound][!]--------------------------- NOW YOU CREATE YOUR PREV AND NEXT BUTTONS --------------------------- [/!]
Previous NextGrated this is how I do it in PHP. I have simply modified the creation ofthe variables to be webcat. If WebCat does not allow the LIMIT in the SQLquery I do not know. I do not use SQL w/webcat.----- Original Message ----- From: "John Hill"
To: "WebDNA Talk" Sent: Thursday, October 02, 2003 10:40 AMSubject: Re: Paging a SQL result...> The quick solution is to have [showif] or [if] statements in your[founditems] that show which rows you want. However, this means that hugeresult sets are still fully returned. This works just fine for smaller (afew hundred or less?) results.>> A cleaner solution would be to get SQL server to only return the rows youwant. I don't believe WebCat can fetch just the specified rows, but youcould probably write your own SQL or even stored procedure to do this foryou.>> Contact me off list for some more specific ideas.>> John.>> >We run Webcatalog 4.5 and use MS SQL Server 2000 for the database - andit> >runs ok.> >> >But I have a problem i wish to devide a search result into pages... Thisis> >pretty easy when you use the Webcatalog flat files databases - there you> >could use the startat property.> >> >But when you use a SQL database things are not so simple...> >> >If you use ASP.NET, ASP or PHP there are ways to show the result inpages -> >but when you use webcatalog you have to do it in the SQL-statement (as I> >understand)> >> >I'm just curious - surely some of you guys can't manage with the"primitive"> >flat-file-db-system Webcatalog have to offer. So how have you made your> >solution to show result in pages in webdna from at sql database?> >> >Hope someone have a good solution....> >> >> >Best regards> >Morten> >> >> >> >-------------------------------------------------------------> >This message is sent to you because you are subscribed to> > the mailing list .> >To unsubscribe, E-mail to: > >To switch to the DIGEST mode, E-mail to> >Web Archive of this list is at: http://webdna.smithmicro.com/>> -- >> ---------------------------------> John A. Hill> Oak Hill Software> Website Development/Consulting> john@oakhillsoftware.com>> -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to> Web Archive of this list is at: http://webdna.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Why not just use the the LIMIT and offset?[!] ----------------- SET THE MAX # TO BE FOUND ------------------ [/!][mathshow=f]maxfound=5[/math][!] ------------------ CHECK TO SEE IF FIRST TIME VIEWING PAGE ------------------- [/!][showif [offset]=[raw][offset][/raw]][text]offset=0[/text][math show=f]prev=-[maxfound][/math][math show=f]next=+[maxfound][/math][/showif][showif [offset]!0][math show=f]prev=[offset]-[maxfound][/math][math show=f]next=[offset]+[maxfound][/math][/showif][!] -------------------------- THEN SET SELECT STATEMENT -------------------------- [/!]select * from FIELD ORDER BY 1 DESC LIMIT [offset],[maxfound][!]--------------------------- NOW YOU CREATE YOUR PREV AND NEXT BUTTONS --------------------------- [/!][thisurl]?offset=[prev]> Previous[thisurl]?offset=[next]> NextGrated this is how I do it in PHP. I have simply modified the creation ofthe variables to be webcat. If WebCat does not allow the LIMIT in the SQLquery I do not know. I do not use SQL w/webcat.----- Original Message ----- From: "John Hill" To: "WebDNA Talk" Sent: Thursday, October 02, 2003 10:40 AMSubject: Re: Paging a SQL result...> The quick solution is to have [showif] or [if] statements in your[founditems] that show which rows you want. However, this means that hugeresult sets are still fully returned. This works just fine for smaller (afew hundred or less?) results.>> A cleaner solution would be to get SQL server to only return the rows youwant. I don't believe WebCat can fetch just the specified rows, but youcould probably write your own SQL or even stored procedure to do this foryou.>> Contact me off list for some more specific ideas.>> John.>> >We run Webcatalog 4.5 and use MS SQL Server 2000 for the database - andit> >runs ok.> >> >But I have a problem i wish to devide a search result into pages... Thisis> >pretty easy when you use the Webcatalog flat files databases - there you> >could use the startat property.> >> >But when you use a SQL database things are not so simple...> >> >If you use ASP.NET, ASP or PHP there are ways to show the result inpages -> >but when you use webcatalog you have to do it in the SQL-statement (as I> >understand)> >> >I'm just curious - surely some of you guys can't manage with the"primitive"> >flat-file-db-system Webcatalog have to offer. So how have you made your> >solution to show result in pages in webdna from at sql database?> >> >Hope someone have a good solution....> >> >> >Best regards> >Morten> >> >> >> >-------------------------------------------------------------> >This message is sent to you because you are subscribed to> > the mailing list .> >To unsubscribe, E-mail to: > >To switch to the DIGEST mode, E-mail to> >Web Archive of this list is at: http://webdna.smithmicro.com/>> -- >> ---------------------------------> John A. Hill> Oak Hill Software> Website Development/Consulting> john@oakhillsoftware.com>> -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to> Web Archive of this list is at: http://webdna.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
"WebDna @"
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Removing [showif] makes a big difference in speed (1997)
Looking for a Manual (1997)
question: writing files textb in webmerch (1997)
WebCatalog [FoundItems] Problem - AGAIN - (1997)
A multi-processor savvy WebCatalog? (1997)
Sending mail (2003)
dreamweaver (2000)
[shell] (2002)
Email notification to one of multiple vendors ? (1997)
Date Range search (1997)
[CART] inside a [LOOP] (1997)
writefile and texte (1997)
Generating Report Totals (1997)
PIXO support (1997)
Not seeing cart info on Invoice.tmpl (was PROBLEM) (1997)
Time Until (1999)
WebCat2 beta 11 - new prefs ... (1997)
WebMerchant 1.6 and https (1997)
[WriteFile] problems (1997)
Search Engine questions ... (2002)