Skip to main content

Resolving ORA-12899 Error: value too large for column (KBA1838)


The page describes how to best mask an Oracle database table and how to avoid and resolve ORA-12899: value too large for column. 

At a Glance  

ORA Error: ORA-12899: value too large for column
Affects ME versions: This issue affects all Masking Versions: 4.x, 5.0, 5.1, 5.2, and 5.3.
OERR:  12899, 00000, "value too large for column %s (actual: %s, maximum: %s)"
// *Cause: An attempt was made to insert or update a column with a value
//         which is too wide for the width of the destination column.
//         The name of the column is given, along with the actual width
//         of the value, and the maximum allowed width of the column.
//         Note that widths are reported in characters if character length
//         semantics are in effect for the column, otherwise widths are
//         reported in bytes.
// *Action: Examine the SQL statement for correctness.  Check source
//          and destination column data types.
//          Either make the destination column wider, or use a subset
//          of the source column (i.e. use substring).
Root Cause: The returned masked value from the masking engine is larger (in the number of characters) than available in the updated column.  The masked value is too wide for the destination column. Two causes are known: 
  1. The masked value is too long - usually from an incorrectly configured algorithm.
  2. The masked character set is in unicode and the column datatype is in 8 bit code. 

This issue is not common as most algorithm trims the masked value prior to updating the value. 

Solution: To resolve this issue ensure that the algorithm is correctly configured and that the masked value is using the correct character encoding. 


This issue happens if an algorithm is incorrectly configured or there is an error. This can happen in Custom Algorithm. To resolve that please contact the provider of the Custom Algorithm. 

The issue can also happen if the character set in the masked value uses more bytes that the character set defined on the column on the database. 


To troubleshoot this issue:

  1. Verify the error and take note of the table and column name (the column name might not be returned). 
  2. Take note on the returned number of characters and what the max in for the column. 
  3. Check the datatype on the masked column on the database. 
  4. Check what type of algorithm is used for this column. 
  5. Try to run Oracle database profiler to see what value was inserted and why it was too large. 



Related Articles

The following articles may provide more information or related information to this article: