@DBFUNCTION
@DBFUNCTION
is a column-conversion function introduced
in Oracle GoldenGate 23ai. 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 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.
Limitations
-
The database function used by
@DBFUNCTION
does 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
@dbfunction
contains single quote'
, then it needs to be written as''
to be parsed correctly. -
@DBFUNCTION
cannot be mapped to key columns. -
@DBFUNCTION
cannot be used as an argument including inside:-
FILTER
orWHERE
clause -
SQLEXEC
-
Other column-conversion functions
-
Another
@DBFUNCTION
-
Example
@DBFUNCTION
to
determine the system timestamp for the ORDERS
table.MAP OE.ORDERS, TARGET OE.ORDERS, COLMAP (USEDEFAULTS, TS = @DBFUNCTION('SYSTIMESTAMP'))