Subject | Re: [firebird-support] Autotrim? |
---|---|
Author | Mark Rotteveel |
Post date | 2012-03-02T08:03:02Z |
On Tue, 28 Feb 2012 07:37:59 -0000, "syn.erpy" <syn.erpy@...> wrote:
shorter string is padded with spaces to the length of the longer string,
and then they are compared. So if two strings have the same prefix and the
rest is a (different) number of spaces, then they are still considered the
same.
Mark
> Hi,thinks
>
> we ran into a little problem regarding blanks.
>
> Try the following code (FB 2.5.1):
>
> <code>
> create exception blank 'blank';
>
> SET TERM ^ ;
>
> create OR alter procedure p_test
> as
> begin
>
> IF (' ' = '') THEN
> exception blank;
> end
> ^
>
> SET TERM ; ^
>
> execute procedure p_test;
>
>
> </code>
>
> If you run it, the exception is raised. My question is why Firebird
> that a blank (or two or three or four for that matter) is the same as anBecause that is what the SQL standard defines: When comparing strings the
> empty string. Is this a bug or an intended feature?
shorter string is padded with spaces to the length of the longer string,
and then they are compared. So if two strings have the same prefix and the
rest is a (different) number of spaces, then they are still considered the
same.
Mark