Subject | Re: [firebird-support] "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-03T09:50:58Z |
Helen Borrie wrote:
and understand (although it was not case here).
LIKE query, but affects all string comparisons (FIELDNAME = ? - prameter
cannot be longer then field). Because it was not an issue in Paradox,
the application, that I'm converting does not check string length before
passing it as parameter. I know, that I need to add such checks everywhere.
--
Virgo Pärna
virgo.parna@...
>I do knwo that. But for more complex queries I find it easier to read
> Wow, that's a strange guess! A "named parameter" is a purely Delphi thing.
and understand (although it was not case here).
>Ok. So it is intended behavior. I discovered it with specific use with
> A parameter is not a variable: it is a placeholder for a data element of a known type. The statement
>
> SELECT * FROM ZZZ WHERE XXX LIKE :XXX
> is passed across the API as
> SELECT * FROM ZZZ WHERE XXX LIKE ?
>
> The XSQLVAR structure has been primed to expect a string of no more
> than 6 characters (that's what VARCHAR(6) prescribes) but you are
> passing 7.
>
LIKE query, but affects all string comparisons (FIELDNAME = ? - prameter
cannot be longer then field). Because it was not an issue in Paradox,
the application, that I'm converting does not check string length before
passing it as parameter. I know, that I need to add such checks everywhere.
--
Virgo Pärna
virgo.parna@...