Oracle9i Supplied PL/SQL Packages and Types Reference
Release 1 (9.0.1)

Part Number A89852-02
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

DBMS_LOGMNR_CDC_SUBSCRIBE, 3 of 9


SUBSCRIBE Procedure

This procedure specifies the source tables and source columns for which the subscriber wants to access change data.

Syntax

There are two versions of syntax for the SUBSCRIBE procedure, each of which specifies the subscriber columns and datatypes. If the subscribers know which publication contains the source columns of interest, the subscribers can use the version of the procedure that contains the publication ID. If they do not know the publication ID, the Change Data Capture system will select a publication based on the supplied source schema and source table.

The following syntax identifies the source table of interest, allowing Change Data Capture to select any publication that contains all source columns of interest.

DBMS_LOGMNR_CDC_SUBSCRIBE.SUBSCRIBE ( 

    subscription_handle

IN NUMBER,

    source_schema

IN VARCHAR2,

    source_table

IN VARCHAR2,

    column_list

IN VARCHAR2)

The following syntax specifies the publication ID for a specific publication that contains the source columns of interest.

DBMS_LOGMNR_CDC_SUBSCRIBE.SUBSCRIBE ( 

    subscription_handle

IN NUMBER,

    publication_id

IN NUMBER,

    column_list

IN VARCHAR2)

Parameters

Table 26-4 SUBSCRIBE Procedure Parameters  
Parameter  Description 

subscription_handle 

Unique number of the subscription handle that was returned by a previous call to the GET_SUBSCRIPTION_HANDLE procedure. 

source_schema 

Schema name where the source table resides. 

source_table 

Name of a published source table. 

column_list 

A comma-separated list of columns from the published source table.  

publication_id 

A valid publication_id, which you can obtain from the ALL_PUBLISHED_COLUMNS view. 

Exceptions

Table 26-5 SUBSCRIBE Procedure Exceptions  
Exception  Description 

ORA-31425  

The specified subscription handle does not exist, or it does not belong to this user or application. 

ORA-31426  

The subscription handle has been activated; additional calls to the SUBSCRIBE procedure are prohibited. You must subscribe to all of the desired tables and columns before activating the subscription. Ensure that the correct subscription handle was specified. 

ORA-31427  

The subscription represented by the subscription handle already contains the schema name and source table. Check the values of the subscription_handle, source_schema, and source_table parameters. Do not attempt to subscribe to the same table more than once using the same subscription handle. 

ORA-31428  

No publication contains all of the specified columns. One or more of the specified columns cannot be found in a single publication. Consult the ALL_PUBLISHED_COLUMNS view to see the current publications and change the subscription request to select only the columns that are in the same publication. 

Usage Notes

Example

EXECUTE sys.DBMS_CDC_SUBSCRIBE.SUBSCRIBE(\

SUBSCRIPTION_HANDLE=>:subhandle, \
SOURCE_SCHEMA=>'scott', \
SOURCE_TABLE=>'emp', \
COLUMN_LIST=>'empno, ename, hiredate');

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, 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