I don't know about oracle, but Sybase and SQL Server have an ANSI_PADDING attribute. If it is off, inserting "test " into a varchar column actually inserts "test". It also affects char, binary, and varbinary columns. From version 7.0 to version 2000, default values for ANSI_PADDING changed, so the behavior of the database, and consequently the applications, changed. Also, the default for ANSI_PADDING is different in different utilities, so the same SQL will run differently in Query Analyzer than ISQL, unless you explicitly set ANSI_PADDING. To make matters worse, each column can have a different setting for ANSI_PADDING, if you try hard enough.
glen -----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
