Top
Enterprise Postgres 17 SP1 Application Development Guide

B.3.1 Specifying a Value Expression with a Data Type Different from the One that can be Specified for Function Arguments

Oracle database

SELECT SUBSTR( col1,
               1,
               col2)
  FROM DUAL;

Note: col1 and col2 are assumed to be CHAR type

Fujitsu Enterprise Postgres

CREATE CAST (CHAR AS INTEGER) WITH INOUT AS IMPLICIT;

SELECT SUBSTR( col1,
               1,
               col2)
  FROM DUAL;
# No changes to SELECT statement;

Note: col1 and col2 are assumed to be CHAR type


Feature differences
Oracle database

If the type can be converted to a data type that can be specified for function arguments, conversion is performed implicitly.

Fujitsu Enterprise Postgres

If the data types are different from each other, or if loss of significance occurs, implicit conversion is not performed.

Conversion procedure

Since the data type of the string length is clear, first execute the following CREATE CAST only once so that the CHAR type value (col2 in the example) specified for the string length is implicitly converted to INTEGER type.

CREATE CAST (CHAR AS INTEGER) WITH INOUT AS IMPLICIT;