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