LCR$_DDL_RECORD Type

If you create or modify a DDL LCR, then make sure the ddl_text is consistent with the base_table_name, base_table_owner, object_type, object_owner, object_name, and command_type attributes.

Note:

When passing a name as a parameter to an LCR constructor, you can enclose the name in double quotes to handle names that use mixed case or lower case for database objects. For example, if a name contains any lower case characters, then you must enclose it in double quotes.

The application does not need to specify a transaction identifier or SCN when it creates an LCR because the apply process generates these values and stores them in memory. If a transaction identifier or SCN is specified in the LCR, then the apply process ignores it and assigns a new value.

LCR$_DDL_RECORD Constructor Function Parameters

The database where the DDL statement occurred. If you do not include the domain name, then the local domain is appended to the database name automatically. For example, if you specify DBS1 and the local domain is .NET, then DBS1.NET is specified automatically. This parameter should be set to a non-NULL value.

command_type

The type of command executed in the DDL statement. This parameter should be set to a non-NULL value.

NULL is also a valid object type. Specify NULL for all object types not listed. The GET_OBJECT_TYPE member procedure returns NULL for object types not listed.

ddl_text

The text of the DDL statement. This parameter should be set to a non-NULL value.

current_schema

The schema that is used if no schema is specified explicitly for the modified database objects in ddl_text. If a schema is specified in ddl_text that differs from the one specified for current_schema, then the schema specified in ddl_text is used.

This parameter should be set to a non-NULL value.

base_table_owner

If the DDL statement is a table related DDL (such as CREATETABLE and ALTERTABLE), or if the DDL statement involves a table (such as creating a trigger on a table), then base_table_owner specifies the owner of the table involved. Otherwise, base_table_owner is NULL.

base_table_name

If the DDL statement is a table related DDL (such as CREATETABLE and ALTERTABLE), or if the DDL statement involves a table (such as creating a trigger on a table), then base_table_name specifies the name of the table involved. Otherwise, base_table_name is NULL.

tag

A binary tag that enables tracking of the LCR. For example, this tag may be used to determine the original source database of the DDL statement if apply forwarding is used.

GET_DDL_TEXT is a member procedure and not a member function to make it easier for you to manage the space used by the CLOB. Notice that the previous example creates temporary space for the CLOB and then frees the temporary space when it is no longer needed.

Syntax

MEMBER FUNCTION GET_DDL_TEXT
ddl_text IN OUT CLOB);

Parameter

Table 108-3 GET_DDL_TEXT Procedure Parameter

Parameter

Description

ddl_text

The DDL text in the DDL LCR

GET_LOGON_USER Member Function

Returns the logon user name.

Syntax

MEMBER FUNCTION GET_LOGON_USER RETURN VARCHAR2;

GET_OBJECT_TYPE Member Function

Returns the type of the object involved for the DDL.

Syntax

MEMBER FUNCTION GET_OBJECT_TYPE RETURN VARCHAR2;

SET_BASE_TABLE_NAME Member Procedure

Sets the base (dependent) table name.

Syntax

MEMBER PROCEDURE SET_BASE_TABLE_NAME(
base_table_name IN VARCHAR2);

Parameter

Table 108-4 SET_BASE_TABLE_NAME Procedure Parameter

Parameter

Description

base_table_name

The name of the base table

SET_BASE_TABLE_OWNER Member Procedure

Sets the base (dependent) table owner.

Syntax

MEMBER PROCEDURE SET_BASE_TABLE_OWNER(
base_table_owner IN VARCHAR2);

Parameter

Table 108-5 SET_BASE_TABLE_OWNER Procedure Parameter

Parameter

Description

base_table_owner

The name of the base owner

SET_CURRENT_SCHEMA Member Procedure

Sets the default schema (user) name.

Syntax

MEMBER PROCEDURE SET_CURRENT_SCHEMA(
current_schema IN VARCHAR2);

Parameter

Table 108-6 SET_CURRENT_SCHEMA Procedure Parameter

Parameter

Description

current_schema

The name of the schema to set as the current schema. This parameter should be set to a non-NULL value.