I am trying to grant permission to all the tables in a particular schema. There are more than 100 tables in that schema and I do not want to type the grant statement for every table like
grant select on table1 to public;
grant select on table2 to public;
I tried to use the following statement.
select 'grant select on',tabname,' to public' from syscat.tables where tabschema='ABC'
This statement creates the select grant statements but does not grant permission. If I use this statement, then I have to export the output to a text file and then execute that text file which I do not want.
I am using DB2 command editor and I do not want to use Linux shell utility.
navch, If you use Control Center, you can do this.
Expand User and Group objects under the database.
Click on Groups.
Right click on Public and select Change.
Click on the Table tab.
Click on Add Table.
Enter or Select a Schema.
Highlight all the tables (CNTL+A if you want everything) and click Ok.
Highlight all the tables (Click the first one, hold SHIFT key down and click the last one).
Change the Select Drop down box to Yes.