ESQL Data Types
When you access table columns or supply values for dynamic parameter markers in Progress/ESQL, the data types of SQL data objects must be assignment compatible with the host language variables in your ESQL application. See "ESQL Data Type Compatibilities." This section lists the SQL data types that Progress supports.
A character string of n characters. You can abbreviate CHARACTER to CHAR. In Progress/SQL, the length is used only to form the default display format (“x(n)”), since character values in Progress are variable-length.
NOTE: In dynamic ESQL, the length value is returned to the LENGTH structure member describing a CHARACTER column in the SQL descriptor area. For more information, see the "Using Dynamic Embedded SQL" section.
INTEGER
A whole number from -2,147,483,648 to 2,147,483,647, inclusive. You can abbreviate INTEGER to INT.
SMALLINT
Maps to the INTEGER data type.
DECIMAL
A decimal number up to 50 digits in length. The precision (m) specifies the number of significant digits. The scale (n) determines the number of digits to the right of the decimal point. The scale can be up to 10 digits (15 when running with the ANSI SQL (-Q) startup parameter). Progress/SQL truncates the value to the specified scale before storing it in the column. You can abbreviate DECIMAL to DEC.
FLOAT
Maps to the DECIMAL data type. By default, the FLOAT data type receives a sliding point format. The value of (m) is currently ignored.
DOUBLE PRECISION
Maps to the DECIMAL data type. The DOUBLE PRECISION data type receives a sliding point format.
DATE
A date from 1/1/32768 B.C. through 12/31/32767 A.D. You can specify dates in this century with the format mm/dd/yy or with mm/dd/yyyy. Dates in other centuries require the format mm/dd/[-]yyyyy or dd/mm/[-]yyyyy, depending on your data format.
LOGICAL
YES/NO or true/false values.
REAL
Maps to the DECIMAL data type.
NUMERIC
Equivalent to DECIMAL.
NOTE: RAW data types are not supported in Progress/ESQL. An attempt to retrieve data of this type will result in an error.When you create or alter tables in your SQL schema, specify these SQL data types for the columns of your tables. Progress, in turn, defines these columns in terms of the five core Progress data types: CHARACTER, DATE, DECIMAL, INTEGER, and LOGICAL.
When you access SQL tables for input or output, your application must provide host language variables or data structure members whose data types correspond to the columns and dynamic parameters referenced in your ESQL statements. For information on the basic C data types available for application storage, see the "Host Language Variables" section in this chapter.
Progress provides a variety of data conversions between different core Progress, SQL, and C data types, depending on whether you are using static or dynamic ESQL. For more information, see "ESQL Data Type Compatibilities."
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |