Subject Re: [IBO] ib_query ignores my data!
Author Geoff Worboys
Nando,

> In my experience, I have never felt the need to trim right spaces.

Just curious, what sort of applications do you write? Business
systems, scientific, repository or what?

In the interactive business applications that I write, the users are
given access to input data into fields. No assumptions are made about
the users computer expertise or level of care. The data is all
carefully validated and reformated according to the business rules -
not according to user whim.

The general assumption when dealing with (potentially untrained) users
is that they dont know what they are doing. That they may (and often
do) add additional spaces into fields accidently and then wonder why
they cannot insert characters later. The result can often lead to
program problems where you check the length of the string to see if it
empty, only to discover that it had one or more spaces - leading to
some interesting and sometimes difficult to track problems.


> I don't think so. IB will happily let you write trailing spaces
> into a VARCHAR field (unless you type them in in a grid with
> IB_WISQL! ;-)). Could you elaborate what do you exactly mean
> with consistence here?

Only that CHAR fields, by definition, are expected to be fixed length,
and so you expect trailing spaces. VARCHAR fields are expected to be
varying. The assumption being (in may case at least) that I have
declared a variable length field because I expect it to be the length
of the significant input characters and I generally dont consider
spaces (or nulls) to be significant.

The reason why I dont consider trailing spaces to be significant in
fields that the user interacts with, is that they are not visible to
the user.


Geoff Worboys
Telesis Computing