Revoke privileges to schema tables
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
You can revoke privileges to the schema tables by generating a file called
revokeallscript.sql that runs by the OpenEdge SQL
Explorer or within a third party SQL tool while connected to the OpenEdge database.
To generate the
revokeallscript.sql file, run
the following ABL code in the OpenEdge procedure editor while connected to the OpenEdge
database:/* Uncomment appropriate line to include ALL tables or only Schema tables in revoke script. Comment out the one that isn't used */
&GLOBAL-DEFINE AllorSchema "Schema"
/*&GLOBAL-DEFINE AllorSchema "All"*/
OUTPUT TO "RevokeAllScript.sql".
FOR EACH _File NO-LOCK &IF {&AllorSchema}="Schema" &THEN WHERE _Tbl-Type NE "T" &ENDIF BY _Tbl-Type:
PUT UNFORMATTED "REVOKE ALL ON " QUOTER(_Owner) "." QUOTER(_FILE-NAME) (IF PROVERSION LT "10.1C" THEN " FROM PUBLIC;" ELSE " FROM PUBLIC GRANTED BY ANY_USER;") SKIP.
PUT UNFORMATTED "COMMIT;" SKIP.
END.
OUTPUT CLOSE.
Note: The SQL commands to revoke SQL
rights on schema tables do not revoke rights on regular database tables.