Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 27 total
Thread VARCHAR and trailing blanks
Tue, Mar 6 2007 1:28 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Hello all

I'm screaming at Tim for allowing VARCHAR to have trailing blanks (DBISAM removed trailing blanks). Whilst I would like to see it altered back, or at least an equivalent if its only me I'll scream, rant, rave and figure something out (triggers look horrible but doable). I don't want Tim spending time on it if its just to satisfy a single user (even if that user is me).

I'd like to know what other people's views are. The ulterior motive is if all of us want it then I'm pretty much guaranteed the feature.


Roy Lambert
Tue, Mar 6 2007 1:37 PMPermanent Link

Charalabos Michael
Hello Roy,

> I'm screaming at Tim for allowing VARCHAR to have trailing blanks
> (DBISAM removed trailing blanks). Whilst I would like to see it
> altered back, or at least an equivalent if its only me I'll scream,
> rant, rave and figure something out (triggers look horrible but
> doable). I don't want Tim spending time on it if its just to satisfy
> a single user (even if that user is me).
>
> I'd like to know what other people's views are. The ulterior motive
> is if all of us want it then I'm pretty much guaranteed the feature.

What's the point having trailing blanks ?

--
Charalabos Michael - [Creation Power] - http://www.creationpower.gr
Tue, Mar 6 2007 3:40 PMPermanent Link

"Ole Willy Tuv"
Roy,

<< I'd like to know what other people's views are. >>

Tim has implemented storage assignment of fixed-length (CHAR) and
variable-length (VARCHAR) values in ElevateDB correctly according to the SQL
specifications.

A space character is a valid character just like any other characters in the
character set. If you don't want trailing spaces, don't put any trailing
spaces when you assign values Smile

Ole Willy Tuv

Tue, Mar 6 2007 3:53 PMPermanent Link

"David Farrell-Garcia"
I have to agree with Ole on this one.  one might want trailing spaces.
This is how big gun databases work as it is the standard, AFAIK. The
data input mechanism should remove them if they are not desired.


--
David Farrell-Garcia
Whidbey Island Software, LLC
Tue, Mar 6 2007 4:08 PMPermanent Link

Charalabos Michael
Hello,

> I have to agree with Ole on this one.  one might want trailing spaces.
> This is how big gun databases work as it is the standard, AFAIK. The
> data input mechanism should remove them if they are not desired.

I agree too.

--
Charalabos Michael - [Creation Power] - http://www.creationpower.gr
Wed, Mar 7 2007 3:06 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ole


A wonderful answer. Try telling that to ham fisted typists/data enterers, also Windows when you cut and paste text.

Along the same lines why bother masking out control characters. After all they're characters and if you don't want them don't type them.


Roy Lambert
Wed, Mar 7 2007 3:06 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Charalabos


You can't agree with both Smiley

Roy Lambert
Wed, Mar 7 2007 3:13 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

David


Out of interest. Do YOU want trailing spaces? If so why?

Roy Lambert
Wed, Mar 7 2007 5:47 AMPermanent Link

"Ole Willy Tuv"
Roy,

<< A wonderful answer. Try telling that to ham fisted typists/data enterers,
also Windows when you cut and paste text.

Along the same lines why bother masking out control characters. After all
they're characters and if you don't want them don't type them. >>

Both spaces and control characters are valid characters, and you can't
expect the database engine to remove valid characters when storing string
data.

I understand that the answer doesn't suite your specific needs, but data
validation is the responsiblity of the DBA/database application developer.

Ole Willy Tuv

Wed, Mar 7 2007 6:59 AMPermanent Link

Chris Erdal
Roy Lambert <roy.lambert@skynet.co.uk> wrote in news:C1DCCF1F-A75B-4BDB-
BABD-5130AE7AB6ED@news.elevatesoft.com:

> Out of interest. Do YOU want trailing spaces? If so why?
>

Roy,

 I'm instinctively with you on this one, as I'm used to using MSSQL with
ANSI_PADDING set to OFF. This means CHARs are fixed-length right-padded
chars, whereas VARCHARs are variable-length character fields with
trailing spaces automatically truncated.

Here's an extract from "SQL Server Books On Line":
-----------------------------------8<------------------------------
If ANSI_PADDING is ON when a char NULL column is created, it behaves the
same as a char NOT NULL column: values are right-padded to the size of
the column. If ANSI_PADDING is OFF when a char NULL column is created, it
behaves like a varchar column with ANSI_PADDING set OFF: trailing blanks
are truncated.

The varchar data type is a variable-length data type. Values shorter than
the size of the column are not right-padded to the size of the column. If
the ANSI_PADDING option was set to OFF when the column was created, any
trailing blanks are truncated from character values stored in the column.
If ANSI_PADDING was set ON when the column was created, trailing blanks
are not truncated.
-----------------------------------8<------------------------------

I began using this primarily because users were searching on char fields
and not finding them because of trailing spaces entered either in the
original data or in the search box.

I presume that Tim is only trying to follow the SQL standard that Ole
Willy Tuv has checked out, which is followed by MSSQL with ANSI_PADDING
set to ON, so we can't really complain.

On the other hand Winkwe can always request an ANSI_PADDING switch in EDB
that works the same as it does in MSSQL Server!
--
Chris
(XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 3 + EDB 1.00 build 6)
Page 1 of 3Next Page »
Jump to Page:  1 2 3
Image