Subject Re: [firebird-support] How to create a string column with significant trailing spaces
Author Thekla Damaschke
Thanks for your answer.
I can't use a special syntax in the queries, because the same program
also runs against
other RDBMS, so I would like to try to define a collation without padding.
I am actually using Firebird2, but I could not find any description
of a difference to 1.5 in this aspect. In the rlease notes there is a
whole chapter on
the new string functions and collations API, but nothing about padding.
Can someone hint me where to find more information and in the optimal
case an
HowTo describing how I can derive a new collation from an existing one,
only just without padding.
I hope I don't need to write and deploy an external lib just for that.
Regards Thekla

Ivan Prenosil wrote:

> It is standard/correct/expected behaviour. There are several ways how
> to make
> search trailing-spaces sensitive:
> - use "LIKE" operator instead of "="
> - use padding character different from your space. Character set OCTETS
> is padded by binary zero, not by space, so try this
> WHERE col = _OCTETS 'xyz'
> - use Firebird 2 where you can define collations that do not pad data
> when comparing
> Ivan
> <>
> .