Change Field Types
Overview
Use the Change Field Types tool whenever you need to change the size and/or type of one or more fields.
For example, you might have a database with an SIC (Standard Industry Code) field of type Text, which is actually a six-digit number. You want to process this field as a number, using it in expressions like:
SIC >= 100000 AND SIC < 200000
You must first convert the field to a numeric data type, such as Integer. The simplest way to do this is with the Retype tool.
In another example, suppose you receive a Microsoft Access database that contains Date fields declared as Text. Because you want to manipulate them as dates instead of text, you use the Change Field Types tool to change the fields to type Date.
When converting text to typed data, you must specify field details that match the format of the text field to be converted.
Change Field Types tool configuration parameters
The Change Field Types tool has one set of configuration parameters in addition to the standard execution options:
Configuration
Item | Description |
---|---|
Field | The name of the field to be changed. |
Type | Sub-configuration describing the type of the new field. See Configuring Data Types. |
Convert new fields | If selected, all fields encountered at run-time that did not exist at configuration time are converted to specified Data Type for new fields. |
Data type for new fields | If Convert new fields is selected, the data type to which new fields will be converted. |
Configure the Change Field Type tool
To configure the Change Field Types tool:
Select the Change Field Types tool, and then go to the Configuration tab on the Properties pane.
Do one of the following:
To change a single field type, select the Field whose type you want to change, and then select the Type column. Select the button to view the Data type dialog box.
To change multiple field types, using the Ctrl or Shift keys, select multiple Fields whose type you want to change, then select and select Change selected types.
To change all field types, select and select Change all types.
Select the desired Data type, and then configure other details specific to a field's data type. See Configuring Data Types for more information.
Optionally, select Flat width and specify the field's column width when output to a Flat File Output tool.
Optionally, select Convert new fields, and then select the type button to configure the Datatype for new fields.
Optionally, go to the Execution tab, and then set Web service options.