To change the data type of a field from INTEGER to INT64:For a single field, this can be done using the "
-> int64" button in the Field Properties dialog of the Data Dictionary tool. It may also be necessary to change to field format to accommodate larger values.
To change all INTEGER fields in a database to INT64, it is necessary to change the
_Data-Type field of the _Field schema table.
The following code examples can be customised to requirement (*):
For a specific Table's INT fields to INT64:
FOR EACH _File NO-LOCK WHERE _file._file-name = "<TABLE_NAME>",
EACH _Field WHERE _Field._Field-name = "FIELD_NAME"
AND _Field._File-Recid = RECID(_File):
ASSIGN
_Field._Data-Type = "INT64"
_Field._Format = "->>>,>>>,>>>,>>9". /* arbitrary, but big enough */
For all Applicaton Table's INT fields to INT64:
FOR EACH _File NO-LOCK WHERE _TBL-Type = 'T', /* user data tables */
EACH _Field WHERE _Field._File-Recid = RECID(_File)
AND _Data-Type = 'INTEGER':
_Data-Type = 'INT64'.
_Format = '->>>,>>>,>>>,>>9'. /* arbitrary, but big enough */
END.
(*) Example code in this solution is provided for general information only. Progress provides tools such as the Data Dictionary tool and the PROUTIL command for performing database maintenance tasks. Custom code is the responsibility of the author and is not supported by Progress Technical Support.
After changing a field's data type from INT to INT64, it is not necessary to dump and load the data or rebuild indexes when the field is an index key. To revert the datatype change, a dump and load is necessary.