Shorten text in itgenrst009 message: value exceeds maximum length

Go to Dutch version

If a text is longer than the maximum length of a column when placed in a row, an error message such as the following will appear:

itgenrst009
The column “col” in “tab” can contain a text of at most 240 characters.
The value “longtext” in row #1 exceeds the maximum length (269 characters).
Ensure that the value fits the maximum capacity of the column.

There are several ways to solve this problem:

  • if it will occur frequently and/or the complete information is relevant: increase the maximum length of the column in the table (if the platform supports this)
  • Shorten the text to fit the maximum length.

Shortening can be done with various SQL functions. Commonly used are:

  • left: remove characters at the end of the text. Especially useful if the most important context is mainly at the beginning.
  • right: remove characters at the beginning of the text. Especially useful if the most important context is mainly at the end.
  • shorten: remove characters in the middle. Especially useful if the most important context is at the very beginning and end.

Some examples of the SQL functions are shown below.

left SQL function

select left(“a-very-long-text”, 8)

Result:

a-very-l

right SQL function

select right(“a-very-long-text”, 8)

Result:

ong-text

shorten SQL function

select left(“a-very-long-text”, 8)

Result:

a-…ext