Top
Enterprise Postgres 17 SP1 Application Development Guide

B.2.3 Obtaining Comparison Result from Values with Different Data Types

Oracle database

SELECT DECODE( col1,
               '1000', 'A',
               '2000', 1,
               'OTHER')
FROM t1;

Note: col1 is assumed to be CHAR(4) type

Fujitsu Enterprise Postgres

SELECT DECODE( col1,
              '1000', 'A',
              '2000', '1',
              'OTHER')
FROM t1;

Note: col1 is assumed to be CHAR(4) type


Feature differences
Oracle database

The data types of all result values are converted to the data type of the first result value.

Fujitsu Enterprise Postgres

Results in an error.

Conversion procedure

Convert using the following procedure:

  1. Check the literal data type for the first result value specified.

  2. Change the literals specified for each result value to the literal data type checked in the step 1.