23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Syntax<br />

Exact numeric data types<br />

<strong>Data</strong> types<br />

Exact numeric data types are used to represent the exact value of a number. This is the syntax<br />

for exact numeric data types:<br />

TINYINT | SMALLINT | INTEGER | BIGINT<br />

| NUMERIC | NUMBER [ ( precision [ , scale ] ) ]<br />

| DECIMAL [ ( precision , scale ) ]<br />

TINYINT<br />

SMALLINT<br />

INTEGER<br />

BIGINT<br />

Corresponds to an integer value in the range –128 to +127 inclusive.<br />

Corresponds to an integer value in the range of –32768 to 32767 inclusive.<br />

Corresponds to an integer value in the range of –2147483648 to 2147483647 inclusive.<br />

Corresponds to an integer value in the range of -9223372036854775808 to<br />

9223372036854775807 inclusive.<br />

NUMERIC | NUMBER [ ( precision [ , scale ] ) ]<br />

Corresponds to a number with the given precision (maximum number of digits) and scale<br />

(the number of digits to the right of the decimal point). By default, NUMERIC columns have<br />

a precision of 32 and a scale of 0. If NUMERIC columns omit the scale, the default scale is 0.<br />

The range of values for a NUMERIC type column is -n to +n where n is the largest number<br />

that can be represented with the specified precision and scale. If a value exceeds the<br />

precision of a NUMERIC column, <strong>SQL</strong> generates an overflow error. If a value exceeds the<br />

scale of a NUMERIC column, <strong>SQL</strong> rounds the value.<br />

NUMERIC type columns cannot specify a negative scale or specify a scale larger than the<br />

precision.<br />

DECIMAL [ ( precision , scale ) ]<br />

Equivalent to type NUMERIC.<br />

Approximate numeric data types<br />

Approximate numeric data types are used to define data with a wide range of values and whose<br />

precision does not have to be exact. This is the syntax for an approximate data type:<br />

Syntax<br />

{ REAL | DOUBLE PRECISION | FLOAT [ ( precision ) ] }<br />

197

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!