Change data types: Character to number

Applies to User Roles:

System Administrator

You can change data types by using System Definition, by using Mass update, or by using the Database Dictionary utility.

Change data types by using System Definition

To change data types by using System Definition:

  1. In the System Navigator, click System Definition > Tables >table_name> Fields > field_name.
  2. Double-click the field name.
  3. In the General properties tab, select a new type from the Data type list.
  4. Click Save.

Change data types by using Mass Update

In this example, records have a character in the zip field that is now defined as a number field.

If some of the records in the file contain data in the modified field that invalidates the new field type, the data is not converted and the system generates a "cannot evaluate" message for each record failing the conversion.

Service Manager updates only those records that do not fail the conversion.

To change data types by using mass update, use the syntax: zip in $file=nullsub{val(zip in $file,1),zip in $file}.

Change data types by using the Database Dictionary utility

This example illustrates how to change the field called zip in the vendor file from a character type field to a number type field. Assume that data exists in the file.

Note: You must use the Windows client whenever you need to add or edit a field/key in a database dictionary table.

To change data types by using the Database Dictionary utility:

  1. Click Tailoring > Database Dictionary.
  2. Type vendor in File Name field, and then click Search.
  3. Select the zip field name.
  4. Click Edit Field/Key.

    The field editing window opens.

  5. In the Type field, choose number in the Type list selection.

    This replaces character with number in the Type field.

  6. Click OK to close the window and commit the change to the file.
  7. Click OK to update your database dictionary record.

    The message Record updated in the dbdict file displays to confirm the update.

    Note: This may not be the end of the process. If records exist in the file, you need to perform a Mass Update to change the field type of the zip field from character to number. (The type of field, for example, character, number, or date/time is stored in the data record with each associated value).

    All records containing a value in the field zip need to be updated to reflect the new field type. For additional information on the Mass Update procedure, see the Database Manager Help.

Related topics

Methods for updating database dictionary records
Methods for deleting database dictionary records
Changing data types
Arrays
Structures
Arrayed structures
Alias fields
Adding a key
Modifying a key
Deleting a key

Access the Database Dictionary utility
Modify field types: Character (scalar) to array
Modify field types: Single to concatenated
Open a database dictionary
Regen a database dictionary