GET_TIMESTAMP
有效對象
擷取與 Replicat
說明
使用 GET_TIMESTAMP 函數可擷取與 ASCII 日期時間格式之來源資料記錄關聯的 I/O 時戳。時間戳記會接著轉換成當地時間,並接近原始資料庫作業的時間。
注意:ASCII 確認時間戳記會隨著日光節約時間的不同區域使用而有所不同。使用者結束程式回呼應以 GMT 時間傳回 ASCII 日期時間,以避免此差異。Oracle GoldenGate 歷程檔使用 GMT 格式。請參閱 GET_GMT_TIMESTAMP 。
語法
#include "usrdecs.h"
short result_code;
record_def record;
ERCALLBACK (GET_TIMESTAMP, &record, &result_code);
緩衝區
typedef struct
{
char *table_name;
char *buffer;
long length;
char before_after_ind;
short io_type;
short record_type;
short transaction_ind;
int64_t timestamp;
exit_ts_str io_datetime;
short mapped;
short source_or_target;
/* Version 2 CALLBACK_STRUCT_VERSION */
char requesting_before_after_ind;
} record_def;
輸入
無
輸出
時戳
傳回的 64 位元 I/O 時戳為 ASCII 格式。
io_datetime
包含本機 I/O 日期與時間的空值終止字串,格式為:
YYYY-MM-DD HH:MI:SS.FFFFFF
傳回值
EXIT_FN_RET_INVALID_CONTEXT
EXIT_FN_RET_OK