Data Types

A data type is a set of values that share processing characteristics. For example, the set of all integers is a data type. Every column, local variable, parameter, and host variable has an associated data type.
idmscu19
A data type is a set of values that share processing characteristics. For example, the set of all integers is a data type. Every column, local variable, parameter, and host variable has an associated data type.
Data Types and Value Sets
The data type limits the set of values that can occur in the column, local variable, parameter, or host variable. The data type also determines the operations that can be performed on values in the column, local variable, parameter, or host variable.
You associate a data type with the following:
  • A column when you define the column
  • An SQL routine local variable when you define the local variable
  • An SQL-invoked routine parameter when you define the parameter
  • A host variable when you declare the host variable
Categories of Data Types
CA IDMS supports the following data types:
Category
Data types
Approximate numeric
DOUBLE PRECISION
FLOAT
REAL
Binary
BINARY
Character string
CHARACTER
VARCHAR (or CHAR VARYING)
Date/time
DATE
TIME
TIMESTAMP
Exact numeric
DECIMAL
INTEGER
LONGINT (or BIGINT)
NUMERIC
SMALLINT
UNSIGNED DECIMAL
UNSIGNED NUMERIC
Graphics character string
GRAPHIC
VARGRAPHIC
ROWID
ROWID
XML data
XML
Determining the Data Type of a Value
The data type of a value in a column, host variable, local variable, or parameter is the data type of the column, host variable, local variable or routine parameter. For example, every value in a column with a data type of INTEGER has a data type INTEGER.
The literal used to represent a value must be appropriate for the data type of the value. For example, 983 represents a numeric value; '983' represents a character value. For more information about literals, see Literals.
Data Types Effect on Processing
The data type of a value determines:
  • Columns, local variables, parameters, and host variables to which it can be assigned
  • Values with which it can be compared
  • Operations where it can be used
  • Results of operations where it is combined with values of other data types
  • Its internal representation and storage requirements