Error while increasing Max Length

puneetgoels1
Tera Guru

I have a custom field in incident table which was initially created to 50 characters but we have a new requirement to change its length to 4000. When I am trying to do that I am getting the below error 

Syntax Error or Access Rule Violation detected by database (BLOB/TEXT column 'a_str_16' used in key specification without a key length)

 

however I have an import set table to incident with same field, when I am trying to update length there, It gets updated without any fuss. Not sure Why?

5 REPLIES 5

HarshTimes
Tera Guru

I have a madrid instance , i tried the similar scenario. create a string field in incident table with length 40 and then increased it to 4000. It worked fine. Can you check what is the type of the field ?

 

-Harsh

BISWAJIT4
Giga Contributor

The error is due to the change in the field length for that field. When we set a String field with length below 255 characters that is considered as the field type as VARCHAR(255) in the database. When we change the length above 255 characters, it becomes the field type TEXT. In other words, this type of error comes, when we convert a table column from non-TEXT type such as VARCHAR into TEXT type with indexing or any constraints applied to that column.

Could you please check whether that field is configured as database index field.

If so, then solution to this problem is to remove that field (TEXT type) column from the index and then try to set the length of the field to 4000.

 

Mark it correct/helpful if it helps you

 

Regards

Biswajit

It seems to make sense. 

 

Whenever I tried deleting the column from index, it creates a new one. Can you let me know how to delete and index

Prins Kumar Gup
Giga Guru

Hi Puneet,

Please see the below link. 

Syntax Error or Access Rule Violation detected by database

Thanks,

PKG