Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Referencing remote object Type

user9098259Aug 5 2013 — edited Aug 6 2013

Good morning,

How can I reference an Object Type created on a remote database?

This is the escenario:

In DATABASE A:

CREATE OR REPLACE

TYPE  USERA.EXPO_EXPEDIENTES_RECAUDOS OID 'DCADCB2EA2344DFAB1D205C03D708359'

AS OBJECT (

   exer_cd_expediente         VARCHAR2 (50),

   exer_id_ident_expediente   VARCHAR2 (30),

   exer_cd_sucursal           NUMBER (3),

   exer_cd_ramo               NUMBER (2),

   exer_nu_poliza             NUMBER (7),

   exer_nu_certificado        NUMBER (9),

   exer_nu_contrato           NUMBER (7),

   exer_cd_nacionalidad       VARCHAR2 (1),

   exer_nu_cedula_rif         NUMBER (9),

   exer_nm_titular            VARCHAR2 (70),

   exer_st_expediente         VARCHAR2 (2),

   exer_de_status_exp         VARCHAR2 (240),

   exer_fe_status_exp         DATE,

   exer_cd_productor          NUMBER (5),

   exer_nm_productor          VARCHAR2 (60),

   exer_cd_mail_productor     VARCHAR2 (50),

   exer_in_habilitado         VARCHAR2 (1),

   exer_in_permite_habilitar  VARCHAR2 (1),

   exer_in_carga_consulta     VARCHAR2 (1),

   exer_cd_ramo_aplicacion    VARCHAR2 (200),

   exer_cd_producto           VARCHAR2 (6)  

   )

/

In DATABASE B:

After creating the public synonym and asigning the required privileges on the object in DATABASE A, I try to execute the following:

DECLARE

      x  EXPO_EXPEDIENTES_RECAUDOS;

BEGIN

      null;

END;

But i got the following error:

ORA-06550: line 2, column 12:

PLS-00331: illegal reference to USERA.EXPC_EXPEDIENTES_RECAUDOS@DATABASEA

After investigating a little i found the following, but i dont know how to apply it, if someone could tell me i would really apreciate it.

"The CREATE TYPE statement has an optional keyword OID, which associates a user-specified object identifier (OID) with the type definition. It should be used by anyone who creates an object type that will be used in more than one database." Source: ( Defining Object Types)

Thanks in advanced.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 3 2013
Added on Aug 5 2013
4 comments
1,417 views