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: When did VARCHAR2 columns store trailing spaces?

Re: When did VARCHAR2 columns store trailing spaces?

From: Jerome Vitalis <vitalismanREMOVETHAT_at_gmail.com>
Date: Fri, 09 Jun 2006 10:30:47 +0200
Message-Id: <pan.2006.06.09.08.30.46.778000@gmail.com>


On Fri, 09 Jun 2006 07:19:16 +0200, Sybrand Bakker wrote:

> On 8 Jun 2006 20:34:47 -0700, "fitzjarrell_at_cox.net"
> <fitzjarrell_at_cox.net> wrote:
>

>>Yes, the formatting isn't the best, but note the trailing spaces I
>>submitted to Oracle remain in the stored value.  I remember when this
>>didn't occur; I'm wondering when this 'broke' and if there is a fix.

>
>
> Oracle doesn't pad automatically.
> However, I don't think Oracle ever trimmed redundant spaces *supplied*
> in an INSERT statement.

I think you're right.
Same behaviour with 9.2.0.7.0:

SQL> create table numtest(my_num number, my_val varchar2(9));

Table created.

SQL> insert into numtest values(0011, '0011 ');

1 row created.

SQL> select my_num, ''''||my_val||'''' from numtest;

    MY_NUM ''''||MY_VA
---------- -----------

        11 '0011 ' Received on Fri Jun 09 2006 - 03:30:47 CDT

Original text of this message

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