sql - DB2 Grant Permissions (like SELECT/INSERT/etc) to all tables of a schema -


i working on db2 work requires me grant following privileges tables within schema:

grant select, index, insert, update, delete, create, drop, alter, create temporary tables on my_scratch_schema.* 'my_user'@'%';

the above query mysql, however, need rewrite db2.

as far know, there's no command grant permissions tables of schema, must rely on procedure. knowing it's db2, there's documentation that's on place works different versions of db2, little not trusting of what's online.

so question - how rewrite above query db2?

there no direct way thru query db2. either create stored procedure or manually. can following too

select 'grant select, index, insert, update, delete, create,  drop, alter, create temporary tables on ' ||  trim(system_table_schema)||'.'||trim(system_table_name) || 'to userid grant option ;'  qsys2.systables system_table_schema ='schemaname' 

run above query , copy result , run result. hope helps. lot of userids, can add them group , provide authoity group name


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -