Subject | "arithmetic exception, numeric overflow, or string truncation" - string is compared differently if it is passed as parameter. |
---|---|
Author | Virgo Pärna |
Post date | 2009-04-03T08:20:04Z |
I tried to post it to newsgroup, but it didn't arrive, so I'm posting it
to mailing list also.
Table ZZZ has VARCHAR(6) field XXX
Following query works without errors:
"SELECT * FROM ZZZ WHERE XXX LIKE '001001%'"
But following query does not:
"SELECT * FROM ZZZ WHERE XXX LIKE :XXX"
where parameter :XXX is set to '001001%'
The error is:
Dynamic SQL Error
SQL Error Code = -303
arithmetic exception, numeric overflow, or string truncation.
I understand, that it is caused by the fact, that parameter is longer
then field name, but is this correct behavior? And why is it behaving
differently, when string is embedded in SQL instead of passing it as
parameter?
The problem rises converting existing application using Paradox
database to Firebird.
--
Virgo Pärna
virgo.parna@...
to mailing list also.
Table ZZZ has VARCHAR(6) field XXX
Following query works without errors:
"SELECT * FROM ZZZ WHERE XXX LIKE '001001%'"
But following query does not:
"SELECT * FROM ZZZ WHERE XXX LIKE :XXX"
where parameter :XXX is set to '001001%'
The error is:
Dynamic SQL Error
SQL Error Code = -303
arithmetic exception, numeric overflow, or string truncation.
I understand, that it is caused by the fact, that parameter is longer
then field name, but is this correct behavior? And why is it behaving
differently, when string is embedded in SQL instead of passing it as
parameter?
The problem rises converting existing application using Paradox
database to Firebird.
--
Virgo Pärna
virgo.parna@...