EGL provides a variety of numeric data types. Some of the numeric types (such as BIGINT or FLOAT) automatically indicate the length and decimal places. For other numeric types (such as BIN or DECIMAL), you must specify the length and (if appropriate) the number of decimal places, as in the following example:
truckMileage BIN(9,2); // 9 digits, two decimal places DataItem zipCode INT { validValues = [00000,99999]}; // 5 digits only myZipCode zipcode;
EGL allocates storage for truckMileage and myZipCode, but not for the zipCode data item, which is only a model.
Primitive | Size | Specify length | Decimals | Data type | DB2® equivalent |
---|---|---|---|---|---|
BIGINT | 18 digits (8 bytes) | N | N | binary | BIGINT |
BIN | 4, 9, or 18 digits (2, 4, or 8 bytes) | Y | Y | binary | n/a |
DECIMAL | 31 digits | Y | Y | packed decimal characters | DECIMAL |
FLOAT | 18 digits (8 bytes) | N | Y | double-precision floating point | FLOAT |
INT | 9 digits (4 bytes) | N | N | binary | INTEGER |
MONEY | 31 digits | Y | Y | packed decimal characters | DECIMAL |
NUM | 31 digits | Y | Y | numeric characters (zoned decimal) | NUMERIC |
NUMC* | 18 digits | Y | Y | numeric characters (zoned decimal) | NUMERIC |
PACF* | 18 digits | Y | Y | packed decimal characters | DECIMAL |
SMALLFLOAT | 9 digits (4 bytes) | N | Y | single- precision floating point | REAL |
SMALLINT | 4 digits (2 bytes) | N | N | binary | SMALLINT |
*NUMC and PACF available only in VisualAge® Generator compatibility mode.
Platform | Issue |
---|---|
JavaScript generation | The following types are supported: ANY, BIGINT,
BIN (but only in the absence of decimal places), Boolean, DataItem,
DATE, DECIMAL, Delegate, Dictionary, FLOAT, INT, NUM, NUMBER, SMALLFLOAT,
SMALLINT, STRING (but only in the absence of a size limit) , TIME,
TIMESTAMP, NUM, MONEY, Service parts, Interface parts, External types
(stereotype JavaScript), arrays of supported types, and non-structured
Basic, Exception, and SQL Record parts. The following types are not supported: ArrayDictionary, BIN (with decimal places), BLOB, CHAR, CLOB, DBCHAR, HEX, INTERVAL, MBCHAR, NUMC, STRING (with a size limit), PACF, UNICODE, and structured Record parts. |