Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: TRIM and SUBSTR not working
Matthias Wirtz <Matthias.Wirtz_at_gmx.net> wrote:
>Hi,
>
>I jus wonder why TRIM and SUBSTR are not working on one Oracle9i database
>server:
>
>SQL*Plus: Release 9.2.0.1.0 - Production on Thu Feb 10 11:47:01 2005
>
>Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
>
>
>Connected to:
>Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
>With the Partitioning, OLAP and Oracle Data Mining options
>JServer Release 9.2.0.1.0 - Production
>
>stat_at_STAT2> select TRIM('Hello ') o from dual;
>
>O
>---------------------------
>Hello
>
>
>
>You see that the string is not trimmed. I would expected (and actually it is
>on a different box) the output like this:
>
>O
>-----
>Hello
>
>
>Same happen with SUBSTR, doesn't work. But why is this different? Are there
>any default sql*plus settings that I'm not aware off?
I cannot reproduce the problem..
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.2.1 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.2.0 - Production
SQL> select trim('Hello ') from dual;
TRIM(
SQL> select substr('thislongstring',2,4) from dual;
SUBS
SQL>
No setting in SqlPlus have been modified..'out-of-the-box' client install. Received on Thu Feb 10 2005 - 11:10:49 CST