You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Hans Holmlund <ha...@excito.se> on 2006/12/07 18:22:26 UTC
Key length for an Index in Entity Engine
I want to create an index on a TEXT column. When doing this the
key-length to use for the index must be specified, otherwise I get the
following error message:
"BLOB/TEXT column 'ABSOLUTE_PATH' used in key specification without a
key length".
How do I specify the key-length in the entitymodel definition?
Thanks,
Hans Holmlund
Re: Key length for an Index in Entity Engine
Posted by David E Jones <jo...@undersunconsulting.com>.
On Dec 7, 2006, at 12:42 PM, Hans Holmlund wrote:
> I am using MySQL and it work if I set the index manually:
> CREATE INDEX xxx ON yyy (zzzz(A_NUMBER));
> But I understand that this is not a SQL standard way of doing this
> and as not all DBs (I think Oracle has a way of doing this) support
> it it is nothing Ofbiz can solve. Period.
There are certainly ways of solving this, and there are many problems
like this that the Entity Engine takes care of through configuration
attributes on the datasource element in the entityengine.xml file.
So, there are a couple of options here. With the Entity Engine you
don't have to use it to define and create meta data in the database.
You can make whatever changes and additions you want there, and
creating indexes is a pretty safe easy thing to do directly in the
database.
The other option is to add an attribute to the datasource element to
support this, and then have the Entity Engine use this syntax when it
is creating indexes, and then you could define your index in OFBiz
and have it maintained across the board.
-David
> David E Jones skrev:
>>
>> I don't know which database you're using, but most databases do
>> not support having a BLOB or CLOB type column in an index or
>> foreign key or primary key, period.
>>
>> My guess is that the error message is leading you to believe
>> something might be possible, but it really isn't possible.
>>
>> The first step is to research this more in the database.
>>
>> -David
>>
>>
>> On Dec 7, 2006, at 10:22 AM, Hans Holmlund wrote:
>>
>>> I want to create an index on a TEXT column. When doing this the
>>> key-length to use for the index must be specified, otherwise I
>>> get the following error message:
>>> "BLOB/TEXT column 'ABSOLUTE_PATH' used in key specification
>>> without a key length".
>>>
>>> How do I specify the key-length in the entitymodel definition?
>>>
>>> Thanks,
>>>
>>> Hans Holmlund
>>
>>
>
Re: Key length for an Index in Entity Engine
Posted by Hans Holmlund <ha...@excito.se>.
I am using MySQL and it work if I set the index manually:
CREATE INDEX xxx ON yyy (zzzz(A_NUMBER));
But I understand that this is not a SQL standard way of doing this and
as not all DBs (I think Oracle has a way of doing this) support it it is
nothing Ofbiz can solve. Period.
/ Hans
David E Jones skrev:
>
> I don't know which database you're using, but most databases do not
> support having a BLOB or CLOB type column in an index or foreign key
> or primary key, period.
>
> My guess is that the error message is leading you to believe something
> might be possible, but it really isn't possible.
>
> The first step is to research this more in the database.
>
> -David
>
>
> On Dec 7, 2006, at 10:22 AM, Hans Holmlund wrote:
>
>> I want to create an index on a TEXT column. When doing this the
>> key-length to use for the index must be specified, otherwise I get
>> the following error message:
>> "BLOB/TEXT column 'ABSOLUTE_PATH' used in key specification without a
>> key length".
>>
>> How do I specify the key-length in the entitymodel definition?
>>
>> Thanks,
>>
>> Hans Holmlund
>
>
Re: Key length for an Index in Entity Engine
Posted by David E Jones <jo...@undersunconsulting.com>.
I don't know which database you're using, but most databases do not
support having a BLOB or CLOB type column in an index or foreign key
or primary key, period.
My guess is that the error message is leading you to believe
something might be possible, but it really isn't possible.
The first step is to research this more in the database.
-David
On Dec 7, 2006, at 10:22 AM, Hans Holmlund wrote:
> I want to create an index on a TEXT column. When doing this the key-
> length to use for the index must be specified, otherwise I get the
> following error message:
> "BLOB/TEXT column 'ABSOLUTE_PATH' used in key specification without
> a key length".
>
> How do I specify the key-length in the entitymodel definition?
>
> Thanks,
>
> Hans Holmlund