Salesforce

What's the quickest way to convert an INTEGER field to INT64 ?

« Go Back

Information

 
TitleWhat's the quickest way to convert an INTEGER field to INT64 ?
URL NameWhat-s-the-quickest-way-to-convert-an-INTEGER-field-to-INT64
Article Number000184455
EnvironmentProduct: OpenEdge
Version: 10.1B and later
OS: All supported platforms
Question/Problem Description
What's the quickest way to convert an INTEGER field to INT64 ?

INTEGER fields need to be changed to INT64 to be able to handle the higher values, otherwise "value too large for integer" errors result.

What's the fast & safe way to convert an INTEGER field in the database to INT64 when values larger than the 32-bit INTEGER can hold need to be stored?
 
Steps to Reproduce
Clarifying Information
Application code uses RECID()
In some cases recid() is converted to a 32-bit INT, and assigned to an INT32 Variable or an INT32 database field which has breached the 32-bit limit with recid(), and the assignment failed with errors like: 15747 13682.
Error MessageValue <value> too large to fit in INTEGER. Line <line> in <procedure>. (15747)
Value <value> too large to fit in INTEGER datatype. (13682)
Defect Number
Enhancement Number
Cause
Resolution
1. To convert the INTEGER Data Type database field:
  • Use the Data Dictionary tool to update the field definition, via the "-> int64" button presented on the UI for all Integer fields.
  • This is the only data type change that can be done without adding a new field of the required data type, since the storage format for INTEGER and INT64 is in fact the same.

2. To make sure the application recognizes the change:

Recompile the code that has static references to the affected table. Failing to do so may still allow the code to run, but it will assume the field is still an INTEGER type. That will lead to error "Value <value> too large to fit in INTEGER datatype. (13682)" or "Value <value> too large to fit in INTEGER. Line <line> in <procedure>. (15747)" when trying to read the larger values from the database.

While it's possible to make the necessary changes online, to avoid side effects it may be preferable to take the environment offline while deploying the new code.

For further methods and considerations when converting a database field Data Type from INT to INT64 refer to Article  Progress INTEGER and INT64 data types   
 
Workaround
Notes
Keyword Phrase
Last Modified Date11/20/2020 7:24 AM

Powered by