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

Home -> Community -> Usenet -> c.d.o.misc -> Re: reports v3.0 query

Re: reports v3.0 query

From: Helen M. Adcock <hell_at_ihug.co.nz>
Date: Thu, 18 Feb 1999 00:20:45 +1300
Message-ID: <7ae8qd$hid$1@newsource.ihug.co.nz>


Try:

select field names from table_name
where title like nvl(:p_title,'%')
and phone like nvl(:p_phone,'%')

Since you're using the "like" operator anyway, this replaces your field with the wildcard, and should include any null values.

HMA janakah_at_hotmail.com wrote in message <7adou0$alv$1_at_nnrp1.dejanews.com>...
>Hi,
>
>I am creating a simple report with number of parameters. If the user leaves
>any one of parameter empty I want to select all records. In my quey
>p_...denotes parameters. So my query is like select field names from
>table_name where title like nvl(:p_title,title) and phone like
>nvl(:p_phone,phone) .... My problem is if any one of these fields contain
a
>null value then the whole record is not selected. Can anyone please tell me
>how to get around this problem.
>
>TIA
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Wed Feb 17 1999 - 05:20:45 CST

Original text of this message

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