Re: How to construct an SQL query?

From: <armaghan_at_usa.net>
Date: Mon, 14 Jun 1999 07:12:15 GMT
Message-ID: <7k2a0c$hpe$1_at_nnrp1.deja.com>


Here is how I do it:
Put '%' as default in Name (or any varchar2 criteria field) Put default dates suitable for the situation (min, max or just today's date in date1 and date2)

Now base you where clause on these fields some thing like this:

WHERE (name LIKE :name)
  AND (date BETWEEN date1 AND date2)

For me this technique saves a lot of time esp when criteria forms are very complex.

Regards,
M. Armaghan Saqib (armaghan_at_geocities.com) Oracle Link for MS Excel. A free tool to integrate XL with Oracle. http://www.geocities.com/WallStreet/Floor/8484/

In article <7k1de5$a29$1_at_nnrp1.deja.com>,   Wassim <net2000_at_francemel.com> wrote:
> Hi,
> suppose that i have a form like this :
> name :
> date : from [ ] to [ ]
>
> [send] [cancel]
>
> i want to know how to construct the SQL query while i can't be done
only
> dynamically because criteria of search are only known after
submission
> of the form, search can be on 'name' only, or 'name'+'from_date' or
the
> 3 criteria..
>
> Have i to do it using UNION between 2 or 3 SELECT query?
> Thanks for help !!
>
> Wassim,
> e-mail: net2000_at_francemel.com
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Mon Jun 14 1999 - 09:12:15 CEST

Original text of this message