Hitachi

Hitachi Advanced Database SQL Reference


8.4.2 CEIL

Returns the smallest integer that is equal to or greater than the target data.

Organization of this subsection

(1) Specification format

scalar-function-CEIL ::= CEIL(target-data)
 
  target-data ::= value-expression

(2) Explanation of specification format

target-data:

Specifies the numeric data to be processed.

The following rules apply:

(3) Rules

  1. The data type of the execution result is shown in the following table.

    Table 8‒2: Data type of the execution result of the scalar function CEIL

    Data type of the target data

    Data type of the execution result

    INTEGER

    INTEGER

    SMALLINT

    SMALLINT

    DECIMAL(p,s)

    DECIMAL(p,0)

    DOUBLE PRECISION

    DOUBLE PRECISION

  2. The NOT NULL constraint does not apply to the value of the execution result (the null value is allowed).

  3. If the target data has the null value, the execution result will be a null value.

(4) Example

Example:

Determine the smallest integer that is equal to or greater than the value of column C1 in table T1, and similarly for columns C2 and C3.

SELECT CEIL("C1"),CEIL("C2"),CEIL("C3") FROM "T1"

[Figure]