Skip Headers

Oracle9i Supplied PL/SQL Packages and Types Reference
Release 2 (9.2)

Part Number A96612-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Logical Change Record Types, 3 of 6


LCR$_ROW_RECORD Type

This type represents a DML change to a row in a table. This type uses the LCR$_ROW_LIST type.

If you create or modify a row LCR, then make sure the command_type attribute is consistent with the presence or absence of old column values and the presence or absence of new column values.


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.

See Also:

"LCR$_ROW_LIST Type"

LCR$_ROW_RECORD Constructor

Creates a SYS.LCR$_ROW_RECORD object with the specified information.

STATIC FUNCTION CONSTRUCT(
   source_database_name       IN VARCHAR2,
   command_type               IN VARCHAR2,
   object_owner               IN VARCHAR2,
   object_name                IN VARCHAR2,
   tag                        IN RAW                DEFAULT NULL,
   transaction_id             IN VARCHAR2           DEFAULT NULL,
   scn                        IN NUMBER             DEFAULT NULL,
   old_values                 IN SYS.LCR$_ROW_LIST  DEFAULT NULL,
   new_values                 IN SYS.LCR$_ROW_LIST  DEFAULT NULL) 
RETURN SYS.LCR$_ROW_RECORD;

LCR$_ROW_RECORD Constructor Function Parameters

Table 108-10 Constructor Function Parameters for LCR$_ROW_RECORD (Page 1 of 2)
Parameter Description

source_database_name

The database where the row change 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 DML statement. This parameter should be set to a non-NULL value.

Valid values are the following:

INSERT
UPDATE
DELETE
LOB ERASE
LOB WRITE
LOB TRIM

If INSERT, then an LCR should have a new_values collection that is not empty and an empty or NULL old_values collection.

If UPDATE, then an LCR should have a new_values collection that is not empty and an old_values collection that is not empty.

If DELETE, then an LCR should have a NULL or empty new_values collection and an old_values collection that is not empty.

If LOB ERASE, LOB WRITE, or LOB TRIM, then an LCR should have a new_values collection that is not empty and an empty or NULL old_values collection.

object_owner

The user who owns the table on which the row change occurred. This parameter should be set to a non-NULL value.

object_name

The table on which the DML statement was executed. This parameter should be set to a non-NULL value.

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 DML change when apply forwarding is used.

See Also: Oracle9i Streams for more information about tags

transaction_id

The identifier of the transaction

scn

The SCN at the time when the change record was written to the redo

old_values

If the DML statement is an UPDATE or a DELETE statement, then the values of columns in the row before the DML statement

new_values

If the DML statement is an UPDATE or an INSERT statement, then the values of columns in the row after the DML statement.

If the LCR reflects a LOB operation, then the supplementally logged columns and any relevant LOB information.

Summary of LCR$_ROW_RECORD Subprograms

Table 108-11 LCR$_ROW_RECORD Subprograms (Page 1 of 2)
Subprogram Description

Common Subprograms

See "Common Subprograms for LCR$_ROW_RECORD and LCR$_DDL_RECORD" for a list of subprograms common to the SYS.LCR$_ROW_RECORD and SYS.LCR$_DDL_RECORD types

"ADD_COLUMN Member Procedure"

Adds the value as old or new, depending on the value type specified, for the column

"DELETE_COLUMN Member Procedure"

Deletes the old value, the new value, or both, for the specified column, depending on the value type specified

"EXECUTE Member Procedure"

Executes the LCR under the security domain of the current user

"GET_LOB_INFORMATION Member Function"

Gets the LOB information for the column

"GET_LOB_OFFSET Member Function"

Returns the LOB offset for the specified column

"GET_LOB_OPERATION_SIZE Member Function"

Gets the operation size for the LOB column

"GET_VALUE Member Function"

Returns the old or new value for the specified column, depending on the value type specified

"GET_VALUES Member Function"

Returns a list of old or new values, depending on the value type specified

"RENAME_COLUMN Member Procedure"

Renames a column in an LCR

"SET_LOB_INFORMATION Member Procedure"

Sets LOB information for the column

"SET_LOB_OFFSET Member Procedure"

Sets the LOB offset for the specified column

"SET_LOB_OPERATION_SIZE Member Procedure"

Sets the operation size for the LOB column

"SET_VALUE Member Procedure"

Overwrites the value of the specified column

"SET_VALUES Member Procedure"

Replaces the existing old or new values for the LCR, depending on the value type specified

ADD_COLUMN Member Procedure

Adds the value as old or new, depending on the value type specified, for the column. An error is raised if a value of the same type already exists for the column.

To set a column value that already exists, run SET_VALUE.

See Also:

"SET_VALUE Member Procedure"

Syntax
MEMBER PROCEDURE ADD_COLUMN(
   value_type     IN VARCHAR2,
   column_name    IN VARCHAR2,
   column_value   IN SYS.AnyData);
Parameters
Table 108-12 ADD_COLUMN Procedure Parameters
Parameter Description

value_type

The type of value to add for the column. Specify old to add the old value of the column. Specify new to add the new value of the column.

column_name

The column name. This name is not validated. An error may be raised during application of the LCRs if an invalid name is specified.

column_value

The value of the column. If NULL, then an error is raised.

A NULL column value can be specified by encapsulating the NULL value in a SYS.AnyData wrapper.

DELETE_COLUMN Member Procedure

Deletes the old value, the new value, or both, for the specified column, depending on the value type specified.

Syntax
MEMBER PROCEDURE DELETE_COLUMN(
   column_name    IN VARCHAR2,
   value_type     IN VARCHAR2  DEFAULT '*');
Parameters
Table 108-13 DELETE_COLUMN Procedure Parameters
Parameter Description

column_name

The column name. An error is raised if the column does not exist in the LCR.

value_type

The type of value to delete for the column. Specify old to delete the old value of the column. Specify new to delete the new value of the column. If * is specified, then both the old and new values are deleted.

EXECUTE Member Procedure

Executes the row LCR under the security domain of the current user. Any apply process handlers that would be run for an LCR are not run when the LCR is applied using this procedure.


Note:

The EXECUTE member procedure can be invoked only in an apply handler for an apply process.


Syntax
MEMBER PROCEDURE EXECUTE(
   conflict_resolution    IN BOOLEAN);
Parameters
Table 108-14 EXECUTE Procedure Parameters
Parameter Description

conflict_resolution

If true, then any conflict resolution defined for the table using the SET_UPDATE_CONFLICT_HANDLER procedure in the DBMS_APPLY_ADM package is used to resolve conflicts resulting from the execution of the LCR.

If false, then conflict resolution is not used.

GET_LOB_INFORMATION Member Function

Gets the LOB information for the column.

The return value can be one of the following:

DBMS_LCR.NOT_A_LOB        CONSTANT NUMBER := 1;
DBMS_LCR.NULL_LOB         CONSTANT NUMBER := 2;
DBMS_LCR.INLINE_LOB       CONSTANT NUMBER := 3;
DBMS_LCR.EMPTY_LOB        CONSTANT NUMBER := 4;
DBMS_LCR.LOB_CHUNK        CONSTANT NUMBER := 5;
DBMS_LCR.LAST_LOB_CHUNK   CONSTANT NUMBER := 6;

Returns NULL if the specified column does not exist.

Syntax
MEMBER FUNCTION GET_LOB_INFORMATION(
  value_type   IN VARCHAR2,
  column_name  IN VARCHAR2) 
RETURN NUMBER;
Parameters
Table 108-15 GET_LOB_INFORMATION Function Parameters
Parameter Description

value_type

The type of value to return for the column, either old or new

column_name

The name of the column

GET_LOB_OFFSET Member Function

Gets the LOB offset for the specified column in the number of characters for CLOB columns and the number of bytes for BLOB columns. Returns a non-NULL value only if all of the following conditions are met:

Otherwise, returns NULL.

Syntax
GET_LOB_OFFSET(
   value_type      IN VARCHAR2,
   column_name     IN VARCHAR2) 
RETURN NUMBER;

Parameters
Table 108-16 GET_LOB_OFFSET Procedure Parameters
Parameter Description

value_type

The type of value to return for the column. Currently, only new can be specified.

column_name

The name of the LOB column

GET_LOB_OPERATION_SIZE Member Function

Gets the operation size for the LOB column in the number of characters for CLOB columns and the number of bytes for BLOB columns. Returns a non-NULL value only if all of the following conditions are met:

Otherwise, returns NULL.

Syntax
MEMBER FUNCTION GET_LOB_OPERATION_SIZE(
  value_type    IN VARCHAR2,
  column_name   IN VARCHAR2) 
RETURN NUMBER,
Parameters
Table 108-17 GET_LOB_OPERATION_SIZE Function Parameters
Parameter Description

value_type

The type of value to return for the column. Currently, only new can be specified.

column_name

The name of the LOB column

GET_VALUE Member Function

Returns the old or new value for the specified column, depending on the value type specified.

Syntax
MEMBER FUNCTION GET_VALUE(
   value_type          IN VARCHAR2,
   column_name         IN VARCHAR2) 
RETURN SYS.AnyData;
Parameters
Table 108-18 GET_VALUE Procedure Parameters
Parameter Description

value_type

The type of value to return for the column. Specify old to get the old value for the column. Specify new to get the new value for the column.

column_name

The column name. If the column is present and has a NULL value, returns a SYS.AnyData instance containing a NULL value. If the column value is absent, returns a NULL.

GET_VALUES Member Function

Returns a list of old or new values, depending on the value type specified.

Syntax
MEMBER FUNCTION GET_VALUES(
   value_type    IN VARCHAR2)
RETURN SYS.LCR$_ROW_LIST;
Parameter
Table 108-19 GET_VALUES Procedure Parameter
Parameter Description

value_type

The type of values to return. Specify old to return a list of old values. Specify new to return a list of new values.

RENAME_COLUMN Member Procedure

Renames a column in an LCR.

Syntax
MEMBER PROCEDURE RENAME_COLUMN(
   from_column_name   IN VARCHAR2,
   to_column_name     IN VARCHAR2,
   value_type         IN VARCHAR2  DEFAULT '*');
Parameters
Table 108-20 RENAME_COLUMN Procedure Parameters
Parameter Description

from_column_name

The existing column name

value_type

The type of value for which to rename the column.

Specify old to rename the old value of the column. An error is raised if the old value does not exist in the LCR.

Specify new to rename the new value of the column. An error is raised if the new value does not exist in the LCR.

If * is specified, then the column names for both old and new value are renamed. An error is raised if either column value does not exist in the LCR.

SET_LOB_INFORMATION Member Procedure

Sets LOB information for the column.

Syntax
MEMBER PROCEDURE SET_LOB_INFORMATION(
  value_type          IN      VARCHAR2,
  column_name         IN      VARCHAR2,
  lob_information     IN      NUMBER);
Parameters
Table 108-21 SET_LOB_INFORMATION Procedure Parameters
Parameter Description

value_type

The type of value to set for the column, either old or new. Specify old only if lob_information is set to DBMS_LCR.NOT_A_LOB.

column_name

The name of the column. An exception is raised if the column value does not exist. You may need to set this parameter for non-LOB columns.

lob_information

Specify one of the following values:

  DBMS_LCR.NOT_A_LOB        CONSTANT NUMBER := 1;
  DBMS_LCR.NULL_LOB         CONSTANT NUMBER := 2;
  DBMS_LCR.INLINE_LOB       CONSTANT NUMBER := 3;
  DBMS_LCR.EMPTY_LOB        CONSTANT NUMBER := 4;
  DBMS_LCR.LOB_CHUNK        CONSTANT NUMBER := 5;
  DBMS_LCR.LAST_LOB_CHUNK   CONSTANT NUMBER := 6;

SET_LOB_OFFSET Member Procedure

Sets the LOB offset for the specified column in the number of characters for CLOB columns and the number of bytes for BLOB columns.

Syntax
SET_LOB_OFFSET(
   value_type      IN VARCHAR2,
   column_name     IN VARCHAR2,
   lob_offset      IN NUMBER);
Parameters
Table 108-22 SET_LOB_OFFSET Procedure Parameters
Parameter Description

value_type

The type of value to set for the column. Currently, only new can be specified.

column_name

The column name. An error is raised if the column value does not exist in the LCR.

SET_LOB_OPERATION_SIZE Member Procedure

Sets the operation size for the LOB column in the number of characters for CLOB columns and bytes for BLOB columns.

Syntax
MEMBER PROCEDURE SET_LOB_OPERATION_SIZE(
  value_type          IN      VARCHAR2,
  column_name         IN      VARCHAR2,
  lob_operation_size  IN      NUMBER);
Parameters
Table 108-23 SET_LOB_OPERATION_SIZE Procedure Parameters
Parameter Description

value_type

The type of value to set for the column. Currently, only new can be specified.

column_name

The name of the LOB column. An exception is raised if the column value does not exist in the LCR.

lob_operation_size

If lob_information for the LOB is or will be DBMS_LCR.LAST_LOB_CHUNK, then can be set to either a valid LOB ERASE value or a valid LOB TRIM value. A LOB_ERASE value must be a positive integer less than or equal to DBMS_LOB.LOBMAXSIZE. A LOB_TRIM value must be a nonnegative integer less than or equal to DBMS_LOB.LOBMAXSIZE.

Otherwise, set to NULL.

SET_VALUE Member Procedure

Overwrites the old or new value of the specified column.

One reason you may want to overwrite an old value for a column is to resolve an error that resulted from a conflict.

Syntax
MEMBER PROCEDURE SET_VALUE(
   value_type       IN VARCHAR2,
   column_name      IN VARCHAR2,
   column_value     IN SYS.AnyData);
Parameters
Table 108-24 SET_VALUE Procedure Parameters
Parameter Description

value_type

The type of value to set. Specify old to set the old value of the column. Specify new to set the new value of the column.

column_name

The column name. An error is raised if the specified column_value does not exist in the LCR for the specified column_type.

column_value

The new value of the column. If NULL is specified, then an error is raised. To set the value to NULL, encapsulate the NULL in a SYS.AnyData instance.

SET_VALUES Member Procedure

Replaces all old values or all new values for the LCR, depending on the value type specified.

Syntax
MEMBER PROCEDURE SET_VALUES(
   value_type     IN VARCHAR2,
   value_list     IN SYS.LCR$_ROW_LIST);
Parameters
Table 108-25 SET_VALUES Procedure Parameters
Parameter Description

value_type

The type of values to replace. Specify old to replace the old values. Specify new to replace the new values.

value_list

List of values to replace the existing list. Use a NULL or an empty list to remove all values.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2000, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback