You can change the datatype of a field in an application table from Int to Int64 while the database remains running. Such a change does not require an exclusive schema lock.

The change takes effect without:
  • Dumping and loading the affected table.
  • Rebuilding indexes, if the affected field is an index key component.
  • Recompiling r-code, if the data stored in the affected fields contains values in the Int range.

Effect on ABL applications

You only need to recompile r-code if the affected fields contain values that exceed the Int range.

For example, an application that uses Buffer-Copy, Buffer-Compare, or Raw transfer statements needs to be recompiled if the changed field contains values greater than the Int range after the datatype has been changed to Int64.

Users might consider changing _Format of the affected fields to reflect any changes.

The Int to Int64 datatype change affects the cyclic redundancy check (CRC) of the table which contains the affected fields, but the AVM adapts to these differences and executes r-code normally. In other words, the AVM will execute the oldr-code without requiring that it be recompiled.

Options to change the schema fields

You can change fields in the _File and _Field schema tables using any one of the following options:
  • Make the change in a development database and then load the delta.df file into the schema online using the data dictionary tool. Be sure to check the Add new objects on-line box.
  • ALTER TABLE or ALTER COLUMN (in OpenEdge SQL)
  • ABL (by updating the schema directly, as in the example below.)

Examples

The following is an example of changing the datatype of the custNum column in the Customer table using ABL:
FIND FIRST _File WHERE _File-name='customer'.
FIND FIRST _Field WHERE _File-Recid = RECID(_File) and _Field-Name='custNum'.
ASSIGN _data-type='int64'.
ASSIGN _Format='->>,>>>,>>>,>>>,>>>'
The following is an example of changing the datatype of the custNum column in the Customer table using SQL:
ALTER TABLE Pub.Customer ALTER COLUMN CustNum SET PRO_DATA_TYPE BIGINT;