Subject Re: [firebird-support] param length limit
Author Helen Borrie
At 05:30 AM 14/01/2006 +0000, you wrote:
>Hi,
>
>I'm using D7+IBX+Firebird 1.5.2
>
>
>This is the SQL in IBQuery1:
>
>select * from grp where gno like :p1
>
>The datatype of gno is varchar(12)
>
>When I assigned '001001001001%' to p1 in application, an error
>raised as:
>
>---------------------------
>Trying to store a string of length 13 into a field that can only
>contain 12.
>---------------------------
>
>It's so strange.
>
>The P1 is not a field, why it is limited to 12 ?

Sure it's a field. It's defined from the metadata returned to the client
when the query is prepared on the server, to be a field of the same size
and type as GNO.

So the only part of this that is strange is why you use LIKE (a wildcard
search) for a test that is offering a search string consisting of the full
12 bytes. All you're doing here is asking for all values that exactly
match or might have one or more characters following the matching
string. The search is invalid, because the column definition precludes the
existence of any values longer than 12. If you intend to pass all 12
characters to the param, use an equality search.

./hb