Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Comparing Null values in PL/SQL with varchar2
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
![]() |
![]() |