Feedback
Did this article resolve your question/issue?

   

Article

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

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
Last Modified Date7/14/2021 4:00 PM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.