How Do Salesforce Types Map to Database Column Types?

The following table describes how Salesforce column data types are mapped to database data types:

Salesforce Type H2 MySQL Oracle(see notes) PostgreSQL SQL/Server
 ANYTYPE  CLOB  TEXT  NCLOB  TEXT  NVARCHAR(MAX)
 BASE64  CLOB  TEXT, MEDIUMTEXT, or LONGTEXT  CLOB  TEXT  VARCHAR(MAX)
 BOOLEAN  BOOLEAN  BOOLEAN DECIMAL(1) BOOLEAN  BIT
 COMBOBOX  NVARCHAR  VARCHAR  NVARCHAR2  VARCHAR  NVARCHAR
 CURRENCY  DECIMAL  DECIMAL  NUMBER  NUMERIC  DECIMAL
 DATACATEGORYGROUPREFERENCE  CHAR  CHAR  CHAR  CHAR  CHAR
 DATE  TIMESTAMP  DATE  DATE  DATE  DATE
 DATETIME  TIMESTAMP  DATETIME  TIMESTAMP(3)  TIMESTAMP  DATETIME
 DOUBLE  DECIMAL  DECIMAL  NUMBER  NUMERIC  DECIMAL
 EMAIL  NVARCHAR  VARCHAR  NVARCHAR2  VARCHAR  NVARCHAR
 ENCRYPTEDSTRING  NVARCHAR  VARCHAR  NVARCHAR2 VARCHAR  NVARCHAR
 ID  CHAR  CHAR  CHAR  CHAR  CHAR
 INT  INTEGER  INTEGER, DECIMAL, or BIGINT  NUMBER  INTEGER  INT or BIGINT
 MULTIPICKLIST  NVARCHAR  VARCHAR  NVARCHAR2  VARCHAR  NVARCHAR
 PERCENT  DECIMAL  DECIMAL  NUMBER  NUMERIC  DECIMAL
 PHONE  NVARCHAR  VARCHAR  NVARCHAR2  VARCHAR  NVARCHAR
 PICKLIST  NVARCHAR  VARCHAR  NVARCHAR2  VARCHAR  NVARCHAR
 REFERENCE  CHAR  CHAR  CHAR  CHAR  CHAR
 STRING  NVARCHAR  VARCHAR  NVARCHAR2  VARCHAR  NVARCHAR
 TEXTAREA  NVARCHAR  VARCHAR  NVARCHAR2  VARCHAR  NVARCHAR
 TIME  TIME  DATETIME  TIMESTAMP(3)  TIME  DATETIME
 URL  NVARCHAR  VARCHAR  NVARCHAR2  VARCHAR  NVARCHAR

Notes

  • The compound type ADDRESS is ignored but its data is picked up in component fields.
  • The compound type LOCATION is ignored but its data is picked up in its component Latitude and Longitude fields.
  • If the length of any string type column exceeds the “Maximum Varchar” parameter then its data type will be the same as used for BASE64 types.

For Oracle Only:

  • CopyStorm can be forced to use a VARCHAR2 rather than NVARCHAR2 by unchecking the “Use NVARCHAR2” option in the Advanced Database Options on the Advanced tab. When CopyStorm creates or modifies a column it chooses a VARCHAR2 or NVARCHAR2 Oracle data type based on the current setting of the “Use NVARCHAR2” option. Note: CopyStorm will not change the data type of an existing column unless the column’s length increases in Salesforce.