Re: How to construct an SQL query?

From: hhh <hhh_at_geocities.com>
Date: Mon, 14 Jun 1999 15:12:02 +0300
Message-ID: <7k2reu$nlf$1_at_news.netvision.net.il>


I Like this way :

select     ....
from        ....
where     name = nvl (:p_name, name) and
                from   = nvl |(:p_from, from) and
                to        = nvl (:p_to, to) and
                date between nvl (:p_date1, to_date ('01/JAN/1900')) and nv
(:p_date2, to_date('31/DEC/3000'));

The function nvl (x,y) means => returns y if x is null else returns x.

(:p_blabla - the parameteres from the form)

                        Haggai.
                        email: haggai_shachar_at_hotmail.com


Wassim wrote in message <7k1de5$a29$1_at_nnrp1.deja.com>...
>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.
Received on Mon Jun 14 1999 - 14:12:02 CEST

Original text of this message