Files
src-1.2/game/server/database/queries/grant_select_permissions.sql
T
2014-01-17 07:03:16 -07:00

23 lines
416 B
SQL

set verify off;
declare
type curtype is ref cursor;
tablelist curtype;
tablename varchar2(200);
begin
open tablelist for
select table_name
from user_tables
where table_name not like '%IOT_OVER%';
loop
fetch tablelist into tablename;
exit when tablelist%notfound;
execute immediate 'grant select on ' || tablename || ' to &&schema';
end loop;
close tablelist;
end;
/
undefine schema;
set verify on;