Re: Create synonym

From: <dmoyer_at_gpu.com>
Date: 1996/05/01
Message-ID: <4m7ha7$cme_at_nn2.fast.net>#1/1


In <Pine.SOL.3.93.960430170335.20204A-100000_at_icarus.cc.uic.edu>, Hong Zhou <hzhou_at_icarus.cc.uic.edu> writes:
>
>I have 50 or so tables, now I want to create synonym for them,
>same name as table name. How can I do this without manully one by one?
>
>Thanks in advance.
>

Try the following: SQL to create SQL ...

set echo off feed off pages 0
spool create_public_synonyms.sql
SELECT 'CREATE PUBLIC SYNONYM ' || object_name || ' FOR IASDBA.' || object_name || ';' FROM user_objects WHERE object_type IN ('PACKAGE','PROCEDURE','SEQUENCE','TABLE','VIEW'); spool off

Note: IASDBA is our schema name.

D. Scott Moyer, Jr.                        dmoyer_at_gpu.com (work)
GPU Service Corporation                dsmoyer_at_enter.net (home)
Reading, PA Received on Wed May 01 1996 - 00:00:00 CEST

Original text of this message