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: empty string or null

Re: empty string or null

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: 29 Mar 2007 07:51:17 -0700
Message-ID: <1175179877.256006.199430@n59g2000hsh.googlegroups.com>


On 29 mrt, 16:44, "Tim B" <nos..._at_someisp.ca> wrote:
> Why does this query return null? I would expect it to return 0. It appears
> trim() is returning null,
> select length(trim(substr(' n',1, 3))) from dual

Because this is Oracle, and Oracle treats empty stings as NULL. Basically your length function gets a NULL, because your substr returns a string,
containing just spaces, and trimming spaces leaves nothing. Received on Thu Mar 29 2007 - 09:51:17 CDT

Original text of this message

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