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: Am I crazy or what?

Re: Am I crazy or what?

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Fri, 13 May 2005 23:45:23 +0200
Message-ID: <d6375b$5be$01$1@news.t-online.com>


gaby_at_ieee.org schrieb:
> Hi,
>
> I'm using the ojdbc14.zip JDBC driver againts an oracle 10g database.
>
> I'm getting one crazy result from a select.
>
> select ...,nvl(attr,'') as attr, ...
> from .... where ...
>
> The attr attribute is a varchar2(150) that allow nulls.
>
> I do resultSet.getString("attr") and it returns me NULL for that
> attribute!!
>
> Is there *any* condition under which the nvl function doesn't return
> null?
>
> *What* is what I'm doing wrong, for the love of God?
>
> TIA,
> Gabriel
>

As the empty string is regarded by Oracle as NULL, your result is correct. NVL would return not null in case you specify the second argument to be NOT NULL too.

Best regards

Maxim Received on Fri May 13 2005 - 16:45:23 CDT

Original text of this message

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