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 />

CEILING<br />

If the expression evaluates to NULL, the result of the function is null. Specifying NULL with the<br />

CAST function is useful for set operations, such as UNION, that require two tables to have the same<br />

structure. CAST NULL allows you to specify a column of the correct data type, so a table with a<br />

similar structure to another, but with fewer columns, can be in a union operation with the other<br />

table.<br />

The CAST function provides a data-type-conversion mechanism compatible with the <strong>SQL</strong><br />

standard.<br />

Use the CONVERT function, enclosed in the ODBC escape clause { fn }, to specify<br />

ODBC-compliant syntax for data type conversion. See “CONVERT (ODBC compatible)” section<br />

on page 86 for more information.<br />

Example The following <strong>SQL</strong> example uses CAST to convert an integer field from a catalog table to a<br />

CHARACTER data type:<br />

CEILING<br />

Syntax<br />

CAST ( { expression | NULL } AS data_type [ ( length )] )<br />

SELECT CAST(fld AS CHAR(25)), fld FROM sysprogress.syscalctable;<br />

CONVERT(CHARACTER(25),FLD) FLD<br />

-------------------------- ---<br />

100 100<br />

1 record selected<br />

Compatibility<br />

<strong>SQL</strong> compatible<br />

Returns the smallest integer greater than or equal to expression.<br />

CEILING ( expression )<br />

Example This example illustrates the CEILING function:<br />

SELECT CEILING (32.5) 'Ceiling'<br />

FROM SYSPROGRESS.SYSCALCTABLE;<br />

Note The expression must evaluate to a numeric data type.<br />

Compatibility<br />

ODBC compatible<br />

83

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

Saved successfully!

Ooh no, something went wrong!