Subject | Re: [Firebird-Java] Firebird 1.5/Hibernate 2.0 |
---|---|
Author | Roman Rokytskyy |
Post date | 2006-02-20T23:31:20Z |
> See attachedWell... after some changes works for me. In your case you use
criteria.add(Expression.ilike("field1", "%s%"));
which generates "SELECT ... FROM ... WHERE lower(...) = ?" SQL, which in
turn generates an error saying that function LOWER is not known. If I change
code to use Expression.like criteria, Hibernate complains being unable to
set "version" property (it contains NULL in the original database). When I
updated the field to contain 1, everything executed just fine.
However I think I know what is the problem in your case... I assume that you
have used declaration of the LOWER function from the ib_udf.sql which is
declared as
DECLARE EXTERNAL FUNCTION lower
CSTRING(255)
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf';
which works only for max. 255 characters. You should have declared it with a
bigger size (just put another value instead of 255, for example 2048), it
should work without any problem then.
You can execute following code in your database:
UPDATE rdb$function_arguments
SET
rdb$field_length = 2048
WHERE
rdb$field_length = 255
AND
rdb$function_name = 'LOWER'
It will change the max. length of the accepter argument. Please confirm if
it helped in your case.
Thanks!
Roman