Consultor Eletrônico



Kbase P149065: How to change fields from INTEGER to INT64 programmatically
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   21/03/2011
Status: Verified

GOAL:

How to change fields from INTEGER to INT64 programmatically

GOAL:

How to automate changing a field from INTEGER to INT64

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.1C
OpenEdge 10.2x

FIX:

To change the data type of a field from INTEGER to INT64, it is necessary to change the _Data-Type field of the _Field schema table. 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 the INTEGER fields in a database to INT64, code similar to the following may be used:
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.