Steve,

The limit does the following.
It processes the full select and then limits the rows returning.
So if the select returns a 100 rows with the limit, then the limit = 20
prevents the last 80 from returning.

Your are better servered by using the COUNT criteria

Ben Johansen - http://www.pcforge.com
Authorized Witango & MDaemon Reseller 
Available for Witango Developement


-----Original Message-----
From: Fogelson, Steve [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 08, 2004 11:12 PM
To: Witango User Group (E-mail)
Subject: Witango-Talk: DBMS Action Select with Limit # or Rows

I am trying to construct a DBMS Select action that will limit the number
of
rows retrieved.

I do a first pass DBMS Select action the first time the taf is executed.
The
purpose of the first pass is to determine the number of rows that meet
the
search criteria.

I do a second pass DBMS Select action each time the taf is executed
again.
The action has a "Start Retrieval at match number" and a "Limit To" for
the
"Number of rows to retrieve". It appears that the "Start Retrieval at
match
number" works fine, but the "number of Rows to retrieve" doesn't. Here
are
results:

1st taf execution
Start Retrieval - 1
Limit to - 14
Rows Retrieved: 1 thru 26

2nd taf execution
Start Retrieval - 15
Limit to - 14
Rows Retrieved: 15 thru 26

First execution retrieved all the records.

I assumed 1st taf execution would retrieve only the first 14 rows.

I tried not selecting a "Limit to" in the "Results" part of the action
(kept
the Start Retrieval) and replacing it with the following DBMS:

SELECT 
  P1.P_ID,
  P1.P_Name,
FROM 
  Products P1 
WHERE 
  (P1.Cat_ID=<@var request$CategoryID> AND P1.P_Disable IS NULL) 
  and LIMIT = <@var request$MaxRows>

1st taf execution
Start Retrieval - 1
Limit to - 14
Rows Retrieved: 1 thru 14

2nd taf execution
Start Retrieval - 15
Limit to - 14
Rows Retrieved: no rows retrieved

Not sure what happened here.

Is my only option the first method I described or is something not
working
correctly? Or is this the way it is supposed to work?

Thanks for comments and ideas.

Steve Fogelson
internet Commerce Solutions
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to