GET_OBJECT_NAME
Valid For
Extract and Replicat
Description
Use the GET_OBJECT_NAME function to retrieve the fully qualified name of a source or target object that is associated with the record being processed. This function is valid tables and other objects in a DML or DDL operation.
To return only part of the object name, see the following:
GET_OBJECT_NAME_ONLY GET_SCHEMA_NAME_ONLY GET_CATALOG_NAME_ONLY
Database object names are returned exactly as they are defined in the hosting database, including the letter case.
Syntax
#include "usrdecs.h" short result_code; env_value_def env_value; ERCALLBACK (GET_OBJECT_NAME, &env_value, &result_code);
Buffer
typedef struct
{
char *buffer;
long max_length;
long actual_length;
short value_truncated;
short index;
short source_or_target;
} env_value_def;Input
-
buffer -
A pointer to a buffer to accept the returned object name. The name is null-terminated.
-
max_length -
The maximum length of your allocated buffer to accept the object name. This is returned as a
NULLterminated string. -
source_or_target -
One of the following indicating whether to return the source or target object name.
EXIT_FN_SOURCE_VAL EXIT_FN_TARGET_VAL
Output
-
buffer -
The fully qualified, null-terminated object name, for example
schema.objectorcatalog.schema.object, depending on the database platform.If the character session of the user exit is set with
SET_SESSION_CHARSETto a value other than the default character set of the operating system, as defined inULIB_CS_DEFAULTin theucharset.hfile, the object name is interpreted in the session character set. -
actual length -
The string length of the returned object name. The actual length does not include the null terminator. The actual length is 0 if the object is a table.
-
value_truncated -
A flag (
0or1) indicating whether or not the value was truncated. Truncation occurs if the length of the object name plus the null terminator exceeds the maximum buffer length.
Return Values
EXIT_FN_RET_INVALID_COLUMN EXIT_FN_RET_INVALID_CONTEXT EXIT_FN_RET_INVALID_PARAM EXIT_FN_RET_OK