Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Creating trigger that calls a package

Creating trigger that calls a package

From: Jacques Raymond Kilchoer <jrkilch_at_costcare.com>
Date: 1997/12/03
Message-ID: <3485E00E.D21AAA00@costcare.com>

--------------74B4A0C34C51614D6B1BA82A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I am creating a trigger that calls a procedure placed inside a package. I have created a synonym for the package name. When I attempt to call the procedure I get an error saying that the package synonym name is undefined. What am I doing wrong?

Below is the information from the schema in which I am trying to create the trigger.

--

SQL> select user from dual ;  /* verify that I am user LETTER */

USER
------------------------------
LETTER


/* verify that package VER_PACK exists */
SQL> select distinct name,type from user_source ; NAME TYPE ------------------------------ ------------ VER_PACK PACKAGE VER_PACK PACKAGE BODY
/* verify that synonym SYN_VER_PACK exists for package VER_PACK */
SQL> select * from user_synonyms where synonym_name = 'SYN_VER_PACK' ; SYNONYM_NAME TABLE_OWNER ------------------------------ ------------------------------ TABLE_NAME ------------------------------ DB_LINK -------------------------------------------------------------------------------- SYN_VER_PACK LETTER VER_PACK
/* create trigger using a procedure in package VER_PACK. I know that the
* procedure ver_condition_eval exists. */ SQL> create or replace trigger letter.b4iu_condition_rule_group 2 before insert or update on condition_rule_group 3 for each row 4 begin 5 letter.syn_ver_pack.ver_condition_eval(:new.rule_id,:new.sub_condition_id); 6 end ; 7 / create or replace trigger letter.b4iu_condition_rule_group * ERROR at line 1: ORA-06550: line 5, column 11: PLS-00302: component 'SYN_VER_PACK' must be declared ORA-06550: line 5, column 4: PL/SQL: Statement ignored ___ ___ (___)=============================================================(___) | | Jacques Raymond Kilchoer MIS:Applications Support | | | | Assistant DBA /^\ ^ (714) 729-4500 x3733 | | | | Cost Care, Inc. /\ _/ \/ \ fax 729-4651 | | | | Newport Beach /\ /\/ \// \ \_/\ | | | | CA 92660 / \ / / \ / \ Suisse/Schweizer | | |___| ____/____\____/_________\___ _\_______ Svizzero |___| (___)=============================================================(___) --------------74B4A0C34C51614D6B1BA82A Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <HTML> I am creating a trigger that calls a procedure placed inside a package. I have created a synonym for the package name. When I attempt to call the procedure I get an error saying that the package synonym name is undefined. What am I doing wrong? <P>Below is the information from the schema in which I am trying to create the trigger.<TT></TT> <P><TT>--</TT><TT></TT> <P><TT>SQL> select user from dual ;&nbsp; /* verify that I am user LETTER */</TT><TT></TT> <P><TT>USER</TT> <BR><TT>------------------------------</TT> <BR><TT>LETTER</TT><TT></TT> <P><TT>/* verify that package VER_PACK exists */</TT> <BR><TT>SQL> select distinct name,type from user_source ;</TT><TT></TT> <P><TT>NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE</TT> <BR><TT>------------------------------ ------------</TT> <BR><TT>VER_PACK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PACKAGE</TT> <BR><TT>VER_PACK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PACKAGE BODY</TT><TT></TT> <P><TT>/* verify that synonym SYN_VER_PACK exists for package VER_PACK */</TT> <BR><TT>SQL> select * from user_synonyms where synonym_name = 'SYN_VER_PACK' ;</TT><TT></TT> <P><TT>SYNONYM_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TABLE_OWNER</TT> <BR><TT>------------------------------ ------------------------------</TT> <BR><TT>TABLE_NAME</TT> <BR><TT>------------------------------</TT> <BR><TT>DB_LINK</TT> <BR><TT>--------------------------------------------------------------------------------</TT> <BR><TT>SYN_VER_PACK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LETTER</TT> <BR><TT>VER_PACK</TT> <BR><TT>&nbsp;</TT> <BR><TT>&nbsp;</TT> <BR><TT>/* create trigger using a procedure in package VER_PACK. I know that the</TT> <BR><TT>&nbsp;* procedure ver_condition_eval exists.</TT> <BR><TT>&nbsp;*/</TT> <BR><TT>SQL> create or replace trigger letter.b4iu_condition_rule_group</TT> <BR><TT>&nbsp; 2&nbsp; before insert or update on condition_rule_group</TT> <BR><TT>&nbsp; 3&nbsp; for each row</TT> <BR><TT>&nbsp; 4&nbsp; begin</TT> <BR><TT>&nbsp; 5&nbsp;&nbsp; letter.syn_ver_pack.ver_condition_eval(:new.rule_id,:new.sub_condition_id);</TT> <BR><TT>&nbsp; 6&nbsp; end ;</TT> <BR><TT>&nbsp; 7&nbsp; /</TT> <BR><TT>create or replace trigger letter.b4iu_condition_rule_group</TT> <BR><TT>*</TT> <BR><TT>ERROR at line 1:</TT> <BR><TT>ORA-06550: line 5, column 11:</TT> <BR><TT>PLS-00302: component 'SYN_VER_PACK' must be declared</TT> <BR><TT>ORA-06550: line 5, column 4:</TT> <BR><TT>PL/SQL: Statement ignored</TT><TT></TT> <P><TT>&nbsp;___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___</TT> <BR><TT>(___)=============================================================(___)</TT> <BR><TT>|&nbsp;&nbsp; | Jacques Raymond Kilchoer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIS:Applications Support |&nbsp;&nbsp; |</TT> <BR><TT>|&nbsp;&nbsp; | Assistant DBA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /^\&nbsp; ^&nbsp;&nbsp;&nbsp;&nbsp; (714) 729-4500 x3733 |&nbsp;&nbsp; |</TT> <BR><TT>|&nbsp;&nbsp; | Cost Care, Inc.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /\&nbsp; _/&nbsp;&nbsp; \/ \&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fax 729-4651 |&nbsp;&nbsp; |</TT> <BR><TT>|&nbsp;&nbsp; | Newport Beach&nbsp;&nbsp; /\ /\/&nbsp; \//&nbsp;&nbsp;&nbsp;&nbsp; \&nbsp; \_/\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; |</TT> <BR><TT>|&nbsp;&nbsp; | CA 92660&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&nbsp; \ /&nbsp;&nbsp;&nbsp; /&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \ /&nbsp;&nbsp; \&nbsp;&nbsp; Suisse/Schweizer |&nbsp;&nbsp; |</TT> <BR><TT>|___|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ____/____\____/_________\___ _\_______&nbsp;&nbsp; Svizzero |___|</TT> <BR><TT>(___)=============================================================(___)</TT> <BR><TT></TT>&nbsp;</HTML> --------------74B4A0C34C51614D6B1BA82A--
Received on Wed Dec 03 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US