Top
Symfoware Server V12.1.0 Application Development Guide
FUJITSU Software

B.4.3 Calculating INTERVAL Values, Including Adding Periods to a Date

Oracle database

SELECT NVL( CURRENT_DATE + (col1 * 1.5), col2)
  FROM t1;

* col1 and col2 are assumed to be INTERVAL YEAR TO MONTH types

Symfoware Server

SELECT NVL( CURRENT_DATE +
        CAST(col1 * 1.5 AS
          INTERVAL YEAR TO MONTH), col2)
  FROM t1;

* col1 and col2 are assumed to be INTERVAL YEAR TO MONTH types


Feature differences
Oracle database

INTERVAL YEAR TO MONTH type multiplication and division result in INTERVAL YEAR TO MONTH type and any fraction (number of days) will be truncated.

Symfoware Server

INTERVAL YEAR TO MONTH type multiplication and division result in INTERVAL type and fractions (number of days) will not be truncated.

Conversion procedure

Convert using the following procedure:

  1. Search locations where the keywords "*" or "/" are used in multiplication or division, and check if the specified value is INTERVAL YEAR TO MONTH type.

  2. If the value is INTERVAL YEAR TO MONTH type, use CAST to explicitly convert the operation result to INTERVAL YEAR TO MONTH type.