Subject | RE: [Firebird-Java] Firebird 1.5/Hibernate 2.0 |
---|---|
Author | Sturdevant, Jonathon |
Post date | 2006-02-21T12:26:08Z |
Roman,
Very good!!! I never would have thought to look there. Yes, in our
database we use that function and when I went in to change it, it was
set to 80, so that was promising.
After some tests, everything works great!! Thanks a million.
-Jon
-----Original Message-----
From: Roman Rokytskyy [mailto:rrokytskyy@...]
Sent: Monday, February 20, 2006 6:31 PM
To: Sturdevant, Jonathon; Firebird-Java@yahoogroups.com
Subject: Re: [Firebird-Java] Firebird 1.5/Hibernate 2.0
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
Very good!!! I never would have thought to look there. Yes, in our
database we use that function and when I went in to change it, it was
set to 80, so that was promising.
After some tests, everything works great!! Thanks a million.
-Jon
-----Original Message-----
From: Roman Rokytskyy [mailto:rrokytskyy@...]
Sent: Monday, February 20, 2006 6:31 PM
To: Sturdevant, Jonathon; Firebird-Java@yahoogroups.com
Subject: Re: [Firebird-Java] Firebird 1.5/Hibernate 2.0
> 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