Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Synonym swap procedure

CrackerJackAug 11 2008 — edited Aug 12 2008

Hi all,

I am trying to create a swapping synonym pl/sql but I am not sure of how case works with subqueries.

I have created procedure mobile_swap2 and mobile_swap2 to load and create the data and to swap the synonyms within these procedures.

create or replace
PROCEDURE SYNONYM_SWAP
     IS
   
BEGIN

case when (select * from all_synonyms where synonym_name = 'MV_RG' and table_name = RG_SWAP1) 
then 

    execute immediate ('execute mobile_swap2');

 
case when (select * from all_synonyms where synonym_name = 'MV_RG' and table_name = RG_SWAP2) 
then     
  execute immediate ('execute mobile_swap1');

END SYNONYM_SWAP;

Please let me kwno if this is feasible.

Message was edited by:
CrackerJack

null

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 9 2008
Added on Aug 11 2008
8 comments
739 views