Generate Oracle Public Synonyms

The following SQL can be used to generate a script to create public synonyms (in Oracle). This example uses the SYSADM user but it can be adapted to suit:

select
  'create public synonym ' || table_name || ' for SYSADM.' || table_name || ';'
from ALL_TABLES
where owner = 'SYSADM';
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License