How do you grant permission to all objects in a schema to other?
DECLARE
sschema VARCHAR2(50) := 'SCOTT';
BEGIN
FOR r1 IN (SELECT object_name, object_type
FROM user_objects
WHERE object_type IN ('TABLE', 'VIEW'))
EXECUTE IMMEDIATE 'grant select, insert, delete, update on ' ||
r1.object_name || ' to ' || sschema;
END LOOP ;
END;
/
DECLARE
sschema VARCHAR2(50) := 'SCOTT';
BEGIN
FOR r1 IN (SELECT object_name, object_type
FROM user_objects
WHERE object_type IN ('PROCEDURE'))
EXECUTE IMMEDIATE 'grant execute on ' || r1.object_name || ' to ' ||
sschema;
END LOOP ;
END;
/
No comments:
Post a Comment