Error while increasing Max Length

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-01-2019 09:37 AM
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?
- Labels:
-
Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-01-2019 05:29 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-01-2019 07:58 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-05-2019 10:31 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-02-2019 05:36 AM
Hi Puneet,
Please see the below link.
Syntax Error or Access Rule Violation detected by database
Thanks,
PKG