Salesforce

SQL query fails when column value exceeds SQL max length or precision

« Go Back

Information

 
TitleSQL query fails when column value exceeds SQL max length or precision
URL Name000065388
Article Number000183091
EnvironmentProduct: OpenEdge
Version: All supported versions
OS: All supported platforms
Other: SQL-92
Question/Problem Description
SQL query fails due to: column <> in table <> has value exceeding SQL max length or precision.

Error 210012 occurs regardless of whether client connects via JDBC or ODBC.

SQL query does not affect all records in the table.

SQL query succeeds when the field listed in the 210012 error message is excluded. 
Steps to Reproduce
Clarifying Information
Error MessageDatabase Connector Error: HY000:[DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE] Column columnName# in table PUB.tableName has value exceeding its max length or precision. [Database Vendor Code: -210012 ]
Defect Number
Enhancement Number
Cause
When the Max Width of a field exceeds the SQL Width value then this SQL queries cannot read field data:
  • SQL-Width is the current SQL Width for the field listed.
  • Max-Width represents the size of the longest data entry in the field. 
Resolution
To address column width discrepancies differences in SQL-Width and Max Width need to be addressed:
  1. Before adjusting the current sql-width in the database schema, consider dumping the record to a text file to check the field content. To find the rowid refer to Article  How to detect fields with problematic SQL-WIDTH with 4GL/ABL   
  2. Progress 9.1D05 and earlier, refer to the code examples in Articles:
  1. Progress 9.1D06, 9.1E, the DBTOOL utility is provided to identify and fix SQL width violations of character and decimal data, as well as identify data values incompatible with SQL-92. DBTOOL with Option 2 (SQL Width Scan w/Fix Option) will report and fix the SQL Width based on the current Max-width found. Refer to Article  What is DBTOOL?   The SQL-WIDTH update will fail due to the 32K bytes field limit on the ABL character type, refer to Article DBTOOL SQL WIDTH crashes with "Unable to upgrade record"
  2. OpenEdge 11.5.1 onward, OpenEdge SQL allows the Authorized Data Truncation (ADT) feature to be enabled at the database or client session so that the selected data fits the defined column size and the part of the value larger than the defined size of the column is truncated.  In OpenEdge 11.6 this feature was further enhanced to dynamically update the SQL Width post query execution with the Autonomous Schema Update (ASU) database feature. Refer to Article  Where to enable the -SQLTruncateTooLarge and -SQLWidthUpdate features  


 
Workaround
Notes
Keyword Phrase
Last Modified Date7/14/2021 4:00 PM

Powered by