@DBFUNCTION
@DBFUNCTION is a column-conversion function introduced in Oracle GoldenGate 26ai. It provides a column mapping to a database function that executes within the database when exectuing a DML operation. This is helpful for applications that are tracking the database timestamp, time-sensitive operations, or ETL loads where the Apply Time of the DML operation within the database is needed. The database function must exist within the database and the Replicat user must have privileges to execute it. For Oracle AI Database, this function is available for all Replicats. For non-Oracle databases, this function is available for Replicat in classic mode, parallel Replicat, and coordinated Replicat.
Also see Native Database Embedding with @DBFUNCTION
Limitations
-
The database function used by
@DBFUNCTIONdoes not allow column as arguments. However, static arguments/constants are supported.For example, the following argument is supported:
TO_CHAR(SYSTIMESTAMP, 'SSSSS.FF')If you want to map this argument (
to_char) with@dbfunction, it can be done as follows:col1 = @dbfunction('TO_CHAR(SYSTIMESTAMP, ''SSSSS.FF'')')If the string mapped to
@dbfunctioncontains single quote', then it needs to be written as''to be parsed correctly. -
@DBFUNCTIONcannot be mapped to key columns. -
@DBFUNCTIONcannot be used as an argument including inside:-
FILTERorWHEREclause -
SQLEXEC -
Other column-conversion functions
-
Another
@DBFUNCTION
-
Example
The following example shows the use of @DBFUNCTION to determine the system timestamp for the ORDERS table.
MAP OE.ORDERS, TARGET OE.ORDERS, COLMAP (USEDEFAULTS, TS = @DBFUNCTION('SYSTIMESTAMP'))