This is what I use for doing those kinds of things, but I also use SA10 so this may need to change a little bit for v8: for tableFor as tableCursor dynamic scroll cursor for select st.table_name as @tableName from systab st where st.table_type = 1 order by st.table_name asc do execute immediate 'grant insert on ' || @tableName || ' to groupName'; end for; Change the |
thank you very much kind sir. i used. the only real change needed is systab needs to be systable other than that it worked awesome. for tableFor as tableCursor dynamic scroll cursor for select st.table_name as @tableName from systable st order by st.table_name asc do execute immediate 'grant update, select, insert on ' || @tableName || ' to TEST_NON_DBA'; end for; |