Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Oracle Miscellaneous > Re: All rows if...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 10 Topic 6816 of 7279
Post > Topic >>

Re: All rows if null

by DA Morgan <damorgan@[EMAIL PROTECTED] > Apr 4, 2008 at 09:31 AM

banaslee wrote:
> Hi there.
> 
> I'm new to oracle and I'd want to build a form search.
> I'm currently using dynamic sql to append all the where clauses that
> has no null values on the corresponding form text boxes but I'm
> searching for a more elegant and static solution.
> 
> In text I can use WHERE nvl(a.foo, ' ') = b.foo || '%' so that if
> b.foo is null it returns all the a.foo rows and I can still use an
> index if I create it like CREATE INDEX foo_idx ON a(nvl(foo, ' ')).
> But what about number values? Is there any better solution for them?
> 
> I hope I had been enough specific on my question.
> 
> Thanks in advance for your help,
> Fábio Oliveira

Use NVL or NVL2. For example:

WHERE NVL(mycol, 'ZZYZX') = or LIKE ...

Alternatively you can use SYS_OP_MAP_NONNULL but its use
is not sup****ted by Oracle.
http://www.psoug.org/reference/undo***ented.html#uomn
-- 
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Wa****ngton
damorgan@[EMAIL PROTECTED]
 (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
 




 10 Posts in Topic:
All rows if null
banaslee <banaslee@[EM  2008-04-04 02:51:25 
Re: All rows if null
DA Morgan <damorgan@[E  2008-04-04 09:31:50 
Re: All rows if null
Ed Prochak <edprochak@  2008-04-04 10:49:23 
Re: All rows if null
banaslee <banaslee@[EM  2008-04-05 06:26:08 
Re: All rows if null
"HansH" <han  2008-04-06 12:54:19 
Re: All rows if null
Urs Metzger <urs@[EMAI  2008-04-06 13:07:34 
Re: All rows if null
banaslee <banaslee@[EM  2008-04-06 16:26:55 
Re: All rows if null
Gints Plivna <gints.pl  2008-04-13 09:08:40 
Re: All rows if null
banaslee <banaslee@[EM  2008-04-14 01:34:50 
Re: All rows if null
Gints Plivna <gints.pl  2008-04-14 11:30:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 21:10:54 CST 2008.