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: Valorize parameter to get alla records

Re: Valorize parameter to get alla records

From: sybrandb <sybrandb_at_gmail.com>
Date: Wed, 22 Aug 2007 02:04:10 -0700
Message-ID: <1187773450.706014.42700@i13g2000prf.googlegroups.com>


On Aug 22, 8:47 am, Fab FaRa <fabrizio.far..._at_email.it> wrote:
> Hi to all!
> I'm executing a query from a my application using paramters for the
> WHERE clausole.
>
> It's possibile force the value of one parameters to work like a jolly
> (*) and get alla the records?
> In this way i can use the same query for a selective selectione or an
> "all recorsd" selection
>
> example:
>
> Select name from mytable where name = :MyName;
>
> Thanks and sorry for may very bad english.

The usual trick is
select name
from mytable
where name like :Myname||'%';
Just leave Myname blank and you will get everything

The wildcard for multiple characters is '%' This can easily be looked in the sql reference manual at http://tahiti.oracle.com and you shouldn't ask for it here.

--
Sybrand Bakker
Senior Oracle DBA
Received on Wed Aug 22 2007 - 04:04:10 CDT

Original text of this message

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