Salesforce

ODBC/JDBC error 7864 caused by insufficient SQL-Width

Information

 
TitleODBC/JDBC error 7864 caused by insufficient SQL-Width
URL Name20008
Article Number000120684
EnvironmentProduct: Progress, OpenEdge
Version: All supported versions
OS: All supported platforms
Other: N/A
Question/Problem Description
Getting error 7864 with SQL-92 client

Error 7864 with ODBC, JDBC clients or SQL explorer querying database
Steps to Reproduce
Clarifying Information
Error MessageColumn <column> in table <table> has value exceeding its max length or precision (7864)

=== SQL Exception 1 ===
SQLState=HY000
ErrorCode=-210012
[JDBC Progress Driver]:Column <field> in table PUB.<file> has value exceeding its max length or precision.
Defect Number
Enhancement Number
Cause
This error appears on a SQL-92 Client when trying to return data stored in a character field greater than the defined SQL width of the field.

With a 4GL connection to a Progress Database there is no size limit for a character field (except the 32k limit for the all record). By default, the SQL-WIDTH is set to twice the length of the displayed format. Since programs may not take the displayed format into account, the data size may easily go beyond the SQL-WIDTH of the field, hence the error with SQL-92 Clients.
Resolution
Option #1
Use DBTOOL, option 2 - "SQL Width Scan w/Fix option" to scan the database and fix any fields where the length of the data exceeds the defined SQL-WIDTH.
Run DBTOOL from the PROENV prompt using the command:

dbtool <databaseName>


Option #2
Expand SQL-WIDTH manually via Data Dictionary by following these steps:

From the Data Dictionary on UNIX:
1) Select Schema.
2) Select SQL Properties.
3) Select the desired table.
4) Change the width for desired field to a number that your data length is (less than 2K).
5) Save.

From Data Dictionary on Windows:
1) Select "SQL Properties" from "Options" menu.
2) Select "Adjust Field Width".
3) Change the width for desired field to a number that your data length is (less than 2K).
4) Save.

Option #3
Change the SQL width programmatically (via the Progress 4GL). A starting point is as follows:

find first _file where _file._file-name = "<table>".
find first _field of _file where _field._field-name = "<column>".
update _field._width.


See Progress Article 000012367 referenced below for more information.
Workaround
Notes
Keyword Phrase
Last Modified Date11/20/2020 7:34 AM

Powered by