Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / July 2006

Tip: Looking for answers? Try searching our database.

BIND, DYNAMICRULES and SQL Procedures

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jayesh Thakrar - 13 Jul 2006 18:11 GMT
My aim is to develop a SQL procedure to create a tablespace which a
qualified end-user can invoke/run.

Since tablespace creation requires SYSADM or SYSCTL authorization and I
want this to procedure to be run by qualified end-users (actually an
application id), I need to have this procedure run with the
authorization id of the package owner (i.e. DBA).

How is this possible for SQL procedures where there is no BIND file
generated (since there is no precompile step)?

Here's a simple version of what I am trying to do -
======================================
drop procedure test_security @

create procedure test_security(in tablespace_name varchar(30), out
result_message varchar(120))

language SQL

begin

declare stmt varchar(1024) ;

set stmt = 'create tablespace ' || tablespace_name || ' managed by
system using ( '|| chr(39) || tablespace_name   || chr(39) || ' ) ' ;

prepare s2 from stmt ;

execute s2 ;

set result_message = stmt ;

end @

======================================

How do I create / bind this procedure so that the runtime privileges
are that of the package owner and NOT the runtime authorization id?

If this were a C or Java procedure, I would have a bind file and this
would not be a problem - but SQL procedure has got me stomped?

All DB2 documentation say that this is easy to do by using the
appropriate DYNAMICRULES - but that is only application to embedded
SQL !

Any help/pointer is greatly appreciated......

Hope you can help,

-- Jayesh
Josh Tiefenbach - 14 Jul 2006 15:06 GMT
> How is this possible for SQL procedures where there is no BIND file
> generated (since there is no precompile step)?

http://publib.boulder.ibm.com/infocenter/db2luw/v8//topic/com.ibm.db2.udb.doc/ad
/t0006584.htm


jsoh
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.