Print Thread
Compiling scripts containing additional SQL commands
#25487 03/27/07 06:21 PM
Joined: Mar 2007
Posts: 1
Toronto
L
lvanek Offline OP
Member
OP Offline
Member
L
Joined: Mar 2007
Posts: 1
Toronto
The standard for writing scripts in our company is to put some boilerplate around the actual object declaration. For example, the following comes after the declaration of a package spec:

show errors;

PROMPT =========================================================================
PROMPT Creating SYNONYM Dbk_Img_Object_Xref
PROMPT =========================================================================
DROP PUBLIC SYNONYM Dbk_Img_Object_Xref;
CREATE PUBLIC SYNONYM Dbk_Img_Object_Xref FOR da.Dbk_Img_Object_Xref;
GRANT EXECUTE ON Dbk_Img_Object_Xref TO cmic_role_all;

PROMPT =========================================================================
PROMPT Completed Dbk_Img_Object_Xref.ps
PROMPT =========================================================================

And the following comes after the package body:

show errors;

PROMPT =========================================================================
PROMPT Created PACKAGE BODY Dbk_Img_Object_Xref
PROMPT =========================================================================

Through your forum I learned to check the

Re: Compiling scripts containing additional SQL commands
#25488 03/27/07 06:42 PM
Joined: Feb 2006
Posts: 14
Plano, Texas USA
C
Member
Offline
Member
C
Joined: Feb 2006
Posts: 14
Plano, Texas USA
Your company's standard of wholesale public synonyming and grants is a little scary - but here's a cool tip, use:

CREATE OR REPLACE PUBLIC SYNONYM syn FOR obj;

It let's bypass at least on error the first time you are executing your boilerplate.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.027s Queries: 14 (0.010s) Memory: 2.4980 MB (Peak: 3.0395 MB) Data Comp: Off Server Time: 2024-04-29 04:32:59 UTC
Valid HTML 5 and Valid CSS