Home » SQL & PL/SQL » SQL & PL/SQL » Grant select on all tables of schema [Merged]
Grant select on all tables of schema [Merged] [message #427882] |
Mon, 26 October 2009 05:21  |
dietbeck
Messages: 6 Registered: October 2009
|
Junior Member |
|
|
Trying this (I want to grant select to one schema on all tables of another schema)
create or replace PROCEDURE GRANT_SELECT (schemaName in varchar2) AS
CURSOR ut_cur IS
SELECT table_name FROM user_tables;
RetVal NUMBER;
sCursor INT;
sqlstr VARCHAR2(250);
BEGIN
FOR ut_rec IN ut_cur
LOOP
sqlstr := 'GRANT SELECT ON '|| ut_rec.table_name
|| ' TO ' || schemaName;
sCursor := dbms_sql.open_cursor;
dbms_sql.parse(sCursor,sqlstr, dbms_sql.native);
RetVal := dbms_sql.execute(sCursor);
dbms_sql.close_cursor(sCursor);
END LOOP;
END grant_select;
getting the following error:
ORA-25191: cannot reference overflow table of an index-organized table
ORA-06512: at "SYS.DBMS_SYS_SQL", line 909
ORA-06512: at "SYS.DBMS_SQL", line 39
ORA-06512: at "ACD.GRANT_SELECT", line 17
ORA-06512: at line 6
Thanks for help
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Jun 06 03:57:33 CDT 2025
|