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: Jeff Kish <jeff.kish_at_mro.com>
Date: Fri, 09 Jun 2006 09:11:34 -0400
Message-ID: <bqsi829j89gp44ohg6jj4ad16u5ua93es7@4ax.com>


<snip>
>>>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 '
>

I concur.. I don't ever remember oracle padding or stripping trailing spacesin a varchar2. Sounds like a bad thing to 'automatically' do especially for a varchar field.
Jeff Kish Received on Fri Jun 09 2006 - 08:11:34 CDT

Original text of this message

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