Subject Re: [Firebird-Java] Jaybird problems using hibernate
Author Danny García Hernández
Thanks Evgeney,

I will try chance our resources api to use contains where use like.


Enviado desde mi iPhone

El 27/10/2013, a las 19:22, Evgeny Putilin <evgeneyputilin@...> escribió:


there is problem in sqlvar parameters structure.

'%111%' has length 5, this is more then varchar(4). Firebird (not jaybird) create internal variable length 4 for process SQL. Unfortunate it is server limitation.
You can use contains operator. for example select * from Bancos where enticed contains  111'
You can ask about this in Firebird newsgroup.

Воскресенье, 27 октября 2013, 14:29 +01:00 от Danny García Hernández <danny@...>:


We have some problems with sql expression width params, jaybird libs throw a DataTruncation exception when params's data data overflow the field sqllen restriction. Expression width "like" using params don't work fine. Example:

create table Bancos (
entidad varchar(4),
        titulo varchar(100)

select * from Bancos where enticed like ?

Width param's value:

1: Work OK. (select * from Bancos where enticed like '%1%')
11: Work OK. (select * from Bancos where enticed like '%11%')
111: ERROR.  Params value is '%111%', one more character than field definition length.


We are using:

Jaybird. 2.2.3
Jdk 1.6
Hibernate: 2.2.4

We use the Criteria Api to access our Backend, then for us is impossible change to use native sql without params.

Any hints?.


WBR Evgeny Putilin