Re: Filter records in HTMLDB 2.0




"Terry Dykstra" <tddykstra@xxxxxxxxxxxx> wrote in message
news:M8Hif.179035$Io.97637@xxxxxxxxxxx
>I have a query that can return a few hundred rows (< 500). Is there any
> way I can then apply a filter on top of that result set to display only a
> specific number of records ( < 20), based on some filter criteria the user
> provides. I rather not be requerying the database all the all time if at
> all possible.
>
> --
> Terry Dykstra
> Canadian Forest Oil Ltd.
>
>
>

lots of ways
are you sayin that there's ~500 rows in your table? or does they query
already have a WHERE clause and you want the use to supply additional
criteria?

in any case, all you do is define an item on the page and reference that
field in the where clause of the query... the 'application' created by the
wizard does this, in its own way, as does the sample application

here's the query syntax: from the sample application (page 2 customers):

select customer_id, cust_last_name || ', ' || cust_first_name customer_name,
CUST_STREET_ADDRESS1 || decode(CUST_STREET_ADDRESS2, null, null, ', ' ||
CUST_STREET_ADDRESS2) customer_address, cust_city, cust_state,
cust_postal_code
from demo_customers
where upper(cust_last_name) like '%' || upper(:P2_SEARCH) || '%'
or upper(cust_first_name) like '%' || upper(:P2_SEARCH) || '%'

I would not recommend using the upper function on the database columns like
they do (unless you have a relatively small table or create a function based
index on the database columns), but this does illustrate referencing a
page's item in the query

++ mcs


.