Top
Symfoware Server V12.1.0 Application Development Guide
FUJITSU Software

B.3.2 Extracting a String with the Specified Format from a Datetime Type Value

Oracle database

SELECT SUBSTR( CURRENT_TIMESTAMP,
               1,
               8)
  FROM DUAL;

Symfoware Server

SELECT SUBSTR( TO_CHAR(CURRENT_TIMESTAMP,
               'DD-MON-YY HH.MI.SS.US PM')
                1,
                8)
  FROM DUAL;

Feature differences
Oracle database

A datetime value such as CURRENT_TIMESTAMP can be specified for character value expressions.

Symfoware Server

A datetime value such as CURRENT_TIMESTAMP cannot be specified for character value expressions.

Conversion procedure

First, specify TO_CHAR for the SUBSTR character value expression.
Specify datetime type (CURRENT_TIMESTAMP, in the example) in firstArg of TO_CHAR, and specify the format template pattern ('DD-MON-YY HH.MI.SS.US PM', in the example) for secondArg to match with the result of SUBSTR before conversion.

TO_CHAR specification format: TO_CHAR(firstArg, secondArg)

Information

Refer to "Data Type Formatting Functions" in the PostgreSQL Documentation for information on format template patterns that can be specified for TO_CHAR in Symfoware Server.