Subject Re: fail when checking VarChar variable <> ''
Author Rick Roen
Thanks Helen,

Actually the missing ':'InternalMemo was a typo, it did exist in my
SP.

I am traveling without your book right now, but I don't see how to
add a collation to my variable declaration.

I tried

declare variable Internalmemo VarChar(2000) Collate 'ISO8859_1'

but no go.

My data is ISO-8859-1 so everything is single byte. I don't think I
can overflow in this case, however in this specific case the data is
only about 500 char long, so there is absolutely no possibility.

If I leave off the "if (InternalMemo <> '') test, all is well in the
sp.


How to add the collation to the variable with FB 1.5.3?

Rick

> >
> >Does this ring any bells with someone? I don't see what I am doing
> >wrong.
>
> this:
>
> Coalesce(SubString(O.MEMO_INTERNAL From 1 For 1990),'')
> into ... InternalMemo
>
> should be
>
> Coalesce(SubString(O.MEMO_INTERNAL From 1 For 1990),'')
> into ... :InternalMemo
>
> Local variables default to character set NONE, so make sure that
the
> variable is declared with the same character set as the stored data
> if the stored data isn't charset NONE...e.g., if your blob is
> unicode_fss then your substring could easily overflow a varchar
(2000).
>
> ./heLen
>