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: Comparing Null values in PL/SQL with varchar2

Re: Comparing Null values in PL/SQL with varchar2

From: fumi <fumi_at_tpts5.seed.net.tw>
Date: 5 Sep 1999 05:31:34 GMT
Message-ID: <7qsv7m$bgj$2@news.seed.net.tw>

Jeroen Hogendoorn <jeroenhog_at_gmx.net> wrote in message news:7qqno8$1bk5$1_at_buty.wanadoo.nl...
> I'm searching for an elegant way to compare two varchar2 vars, what i want
> is this
>
> var1 var2 result
> '' '' true
> null null true
> 'aa' 'aa' true
> 'a' 'b' false
>
> when using nvl() like this:
>
> a varchar2(10);
> b varchar2(10);
>
> if nvl(a,'blabla') = nvl(b,'blabla')
> then
> et etc.
>
> i always have to be sure that b or a cannot be 'blabla', can anybody tell me
> what a better solution is, WITHOUT writing all the code out ( if a is null )
> ?????
>
> Please reply with e-mail: jeroenhog_at_gmx.net
>
> greetings and thanks in advance Jeroen

Hi, Jerone,
You can use:

    if a||'blabla'=b||'blabla' then Received on Sun Sep 05 1999 - 00:31:34 CDT

Original text of this message

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