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

Home -> Community -> Usenet -> c.d.o.server -> Re: how to construct an SQL query ?

Re: how to construct an SQL query ?

From: Wassim <net2000_at_francemel.com>
Date: Mon, 14 Jun 1999 11:05:46 GMT
Message-ID: <7k2nm8$m72$1@nnrp1.deja.com>


Yes, im talking here about doing it using PL/SQL but you don't tell me how to do, i want to do it with only ONE query? thanks !

In article <37649FD9.A4069BCD_at_cl-ki.uni-osnabrueck.de>,   karsten reincke <kreincke_at_cl-ki.uni-osnabrueck.de> wrote:
> Wassim 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 !!
>
> (1) you have to create a cgi-script where you build the final form the
> SQL-query by evaluating your parameters.
>
> (2) you have three possibilties:
>
> (a) SELECT * FROM table WHERE name=FORMNAME
> (b) SELECT * FROM table WHERE name=FORMNAME AND from=FORMFROM
> (c) SELECT * FROM table WHERE name=FORMNAME AND from=FORMFROM AND
> to=FORMTO
>
> the other possibilities seem to be more or less syntactical sugar:
>
> (3) instead of creating 3 autnonom queries you could create one query
> using different variables (we are talking about your cgi-language, not
> directly about oracle)
>
> (4) you could also create two views.
>
> BUT in all cases you have to organize the decision about the form of
the
> query logically outside of oracle in a computing language (PL/SQL, C,
> PERL ...)
>
> --
> salut d'Allemagne kr
> -----------------------------------
> les chats cont les vrais hédonistes
> et devraient être donc notre idéal.
> -----------------------------------
> karsten reincke [ 0541/9696223 ]
> kreincke_at_cl-ki.uni-osnabrueck.de
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Mon Jun 14 1999 - 06:05:46 CDT

Original text of this message

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