Subject | Re: Error on UTF8 in concatenation? |
---|---|
Author | Milan Babuskov |
Post date | 2007-07-25T09:30:37Z |
--- Martijn Tonies wrote:
CAST first column to varchar:
SELECT cast(R.RDB$RELATION_ID || '=' as varchar(33)), R.RDB$RELATION_NAME
FROM RDB$RELATIONS R
order by 1
My guess is that Firebird tries to sort the first column as INTEGER
since RDB$RELATION_ID is integer. However, when you add '=' it cannot
be converted to integer anymore - and thus the error.
--
Milan Babuskov
http://www.guacosoft.com
> This SQL:It also works if you remove ORDER BY clause. And it also works if you
> SELECT R.RDB$RELATION_ID || '=', R.RDB$RELATION_NAME
> FROM RDB$RELATIONS R
> ORDER BY 1 ASC
>
> returns this error on an UTF8 database:
> arithmetic exception, numeric overflow, or string truncation
>
> If I remove the || '=' part, it works fine though.
CAST first column to varchar:
SELECT cast(R.RDB$RELATION_ID || '=' as varchar(33)), R.RDB$RELATION_NAME
FROM RDB$RELATIONS R
order by 1
My guess is that Firebird tries to sort the first column as INTEGER
since RDB$RELATION_ID is integer. However, when you add '=' it cannot
be converted to integer anymore - and thus the error.
--
Milan Babuskov
http://www.guacosoft.com