Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Creating trigger that calls a package
--------------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 ------------------------------ LETTERReceived on Wed Dec 03 1997 - 00:00:00 CST
/* 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 ; /* 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 TYPE</TT> <BR><TT>------------------------------ ------------</TT> <BR><TT>VER_PACK PACKAGE</TT> <BR><TT>VER_PACK 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 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 LETTER</TT> <BR><TT>VER_PACK</TT> <BR><TT> </TT> <BR><TT> </TT> <BR><TT>/* create trigger using a procedure in package VER_PACK. I know that the</TT> <BR><TT> * procedure ver_condition_eval exists.</TT> <BR><TT> */</TT> <BR><TT>SQL> create or replace trigger letter.b4iu_condition_rule_group</TT> <BR><TT> 2 before insert or update on condition_rule_group</TT> <BR><TT> 3 for each row</TT> <BR><TT> 4 begin</TT> <BR><TT> 5 letter.syn_ver_pack.ver_condition_eval(:new.rule_id,:new.sub_condition_id);</TT> <BR><TT> 6 end ;</TT> <BR><TT> 7 /</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> ___ ___</TT> <BR><TT>(___)=============================================================(___)</TT> <BR><TT>| | Jacques Raymond Kilchoer MIS:Applications Support | |</TT> <BR><TT>| | Assistant DBA /^\ ^ (714) 729-4500 x3733 | |</TT> <BR><TT>| | Cost Care, Inc. /\ _/ \/ \ fax 729-4651 | |</TT> <BR><TT>| | Newport Beach /\ /\/ \// \ \_/\ | |</TT> <BR><TT>| | CA 92660 / \ / / \ / \ Suisse/Schweizer | |</TT> <BR><TT>|___| ____/____\____/_________\___ _\_______ Svizzero |___|</TT> <BR><TT>(___)=============================================================(___)</TT> <BR><TT></TT> </HTML> --------------74B4A0C34C51614D6B1BA82A--