Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Filter records in HTMLDB 2.0

Re: Filter records in HTMLDB 2.0

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Tue, 29 Nov 2005 11:40:12 -0500
Message-ID: <9NWdnY5Sj6XxGRHeRVn-qQ@comcast.com>

"Terry Dykstra" <tddykstra_at_forestoil.ca> wrote in message news:Dy_if.225690$ir4.83175_at_edtnps90...
>I don't want to requery the database all the times, as that's expensive.
> On the client side I want the user to be able to 'play' with the result
> set,
> filtering out only records they are interested in. (Sort of like using
> the
> AutoFilter function in Excel).
> Maybe I'm not approaching this right, but I'm used to doing things like
> this
> in PowerBuilder.
>
> --
> Terry Dykstra
> Canadian Forest Oil Ltd.
>
>
> "Mark C. Stock" <mcstockX_at_Xenquery .com> wrote in message
> news:ktadndtbTZSOJBbeRVn-hQ_at_comcast.com...
>>
>> "Terry Dykstra" <tddykstra_at_forestoil.ca> wrote in message
>> news:M8Hif.179035$Io.97637_at_clgrps13...
>> >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
>>
>>
>
>

  1. don't top post -- sends people in this forum ballistic
  2. every submit to 'requeries' the database -- don't worry about it, the database is in a much better position to manipulate 500 rows than the browser is (that's what it's built for)
  3. you're not doing client-server anymore (PowerBuilder) you're doing web -- to do what you want to on the client side (in the browser), you need to write client-side code, which means JavaScript or the like. HTML DB allows you to hook JavaScript into its app structure, but it really sounds like requerying the database is the way to go -- especially if you're only dealing with 500 rows (a pittance to the database, but too much for the browser)

++ mcs Received on Tue Nov 29 2005 - 10:40:12 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US