SQL> create table test (field1 varchar(10), field2 varchar2(10), 
  2  field3 char(10));

Table created.

SQL> insert into test values (' test ',' test ',' test ');

1 row created.

SQL> select field1||'-'||field2||'-'||field3||'-'
  2  from test;

FIELD1||'-'||FIELD2||'-'||FIELD3|
---------------------------------
 test - test - test     -

     Each has the preceding whitespace in it, and the trailing whitespace
showing up.  The char field is 10-chars long.  This is on an Oracle 8.1.5
enterprise system.

-----Original Message-----
From: Michael Peppler [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 3:38 PM
To: Jeff Hunter
Cc: Peter J. Holzer; '[EMAIL PROTECTED] '
Subject: Re: Whitespace being truncated with Oracle


Jeff Hunter writes:
 > I agree, it should be fixed.
 > 
 > Peter J. Holzer wrote:
 > 
 > >I don't think the current behaviour[1] is correct. In perl, strings can
 > >have trailing spaces: "test" and "test " compare as not equal.
 > >In Oracle varchar2 can store strailing spaces: If I store 'test ' in a
 > >varchar2 column, I get back 'test ' and not 'test' or 'test        '.

Are you *sure* that you get 'test ' back???

I'm not be an Oracle specialist, but I know that trailing spaces in
varchar() columns are normally removed on insert. This is definitely
the case for Sybase - irrespective of the client that is used to
access the data. I also seem to recall that this behaviour is a SQL
standard. 

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
[EMAIL PROTECTED]           *or*          [EMAIL PROTECTED]
http://www.mbay.net/~mpeppler
International Sybase User Group: http://www.isug.com

Reply via email to