Fowler, Jeff wrote:
Hello All,
Not trying to be antagonistic, but I'm curious to know how many of you agree with Darren's sentiments on this issue. To restate briefly, ANSI SQL-92 specifies that when comparing two character fields, trailing spaces should be ignored.

My $0.02.

If we are ignoring trailing spaces, then by definition:

' ' = ''

and for that matter:

'          ' = '  '

whereas

'xxxxxxxxxx' <> 'xxx'

Therefore, from the standpoint of arbitrary text,

A may or may not actually be identical to B when A = B

I don't consider that type of result to be predicable and therefore would respectfully state that the standard is a potential source of bugs.

What could be useful is a function:

SELECT * FROM FOO WHERE TRIM(BAR) = TRIM(:bar)

or even a shortcut function along the lines of:

SELECT * FROM FOO WHERE TEXT_EQUIVALENT(BAR, :bar)

However, in my opinion, the operator '=' is better reserved as defining strict equality.


John

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to