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 -> running into problem with package.

running into problem with package.

From: SP <sdpantDeleteThisToReply_at_yahoo.com>
Date: Fri, 19 Dec 2003 17:21:14 GMT
Message-ID: <esGEb.47162$vn.111356@sea-read.news.verio.net>


Hi all,
I'll explain this first. First, synonym STATUS for userA is dropped if one exists for that user otherwise will go to exception handler. After the first drop statement there shouldn't be any synonym named 'STATUS' owned by userA. But on execution they both are being handled by exception handler. But when I run seperately they run just fine. It's not the permission issue as this statement is being run by a account with DBA privilege and when the statements are run seperately (not from inside package) they just run fine. Any help would be appreciated.
TIA,
SP

CREATE OR REPLACE PACKAGE TEST_Utilities AS
PROCEDURE SwitchToSourceA;
END TEST_Utilities;
/

CREATE OR REPLACE PACKAGE BODY TEST_Utilities IS PROCEDURE SwitchToSourceA IS
BEGIN
    BEGIN EXECUTE IMMEDIATE ('DROP SYNONYM userA.STATUS'); EXCEPTION WHEN OTHERS THEN NULL; END;
    BEGIN EXECUTE IMMEDIATE ('CREATE SYNONYM userA.STATUS FOR userB.STATUS'); EXCEPTION WHEN OTHERS THEN NULL; END; END SwitchToSourceA;

END;
/
Received on Fri Dec 19 2003 - 11:21:14 CST

Original text of this message

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