8.12 GET_BASE_SCHEMA_NAME_ONLY

Description

Use the GET_BASE_SCHEMA_NAME_ONLY function to retrieve the name of the owner (such as schema), but not the name, of the base object of the source or target object associated with the record being processed. This function is valid for DDL operations.

To return the fully qualified name of a base object, see the following:

GET_BASE_OBJECT_NAME

To return only the unqualified base object name, see the following:

GET_BASE_OBJECT_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_BASE_SCHEMA_NAME_ONLY, &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 schema name. The name is null-terminated.

max_length

The maximum length of your allocated buffer to accept the schema name. This is returned as a NULL terminated string.

source_or_target

One of the following indicating whether to return the source or target schema name.

EXIT_FN_SOURCE_VAL
EXIT_FN_TARGET_VAL

Output

buffer

The fully qualified, null-terminated schema name.

If the character session of the user exit is set with SET_SESSION_CHARSET to a value other than the default character set of the operating system, as defined in ULIB_CS_DEFAULT in the ucharset.h file, the schema name is interpreted in the session character set.

actual_length

The string length of the returned name. The actual length does not include the null terminator.

value_truncated

A flag (0 or 1) indicating whether or not the value was truncated. Truncation occurs if the length of the schema 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