Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: empty string or null
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
![]() |
![]() |