558: CLOSE s;
559: --
560: -- Drop the view just in case
561: --
562: AD_DDL.DO_DDL( applsys_schema
563: , 'PJM'
564: , AD_DDL.DROP_VIEW
565: , 'DROP VIEW ' || X_synonym_name
566: , X_synonym_name );
560: -- Drop the view just in case
561: --
562: AD_DDL.DO_DDL( applsys_schema
563: , 'PJM'
564: , AD_DDL.DROP_VIEW
565: , 'DROP VIEW ' || X_synonym_name
566: , X_synonym_name );
567:
568: create_flag := 'Y';
572: --
573: -- Synonym exists but points to a different object. We need to drop
574: -- the existing synonym first before recreating the new one
575: --
576: AD_DDL.DO_DDL( applsys_schema
577: , 'PJM'
578: , AD_DDL.DROP_SYNONYM
579: , 'DROP SYNONYM ' || X_synonym_name
580: , X_synonym_name );
574: -- the existing synonym first before recreating the new one
575: --
576: AD_DDL.DO_DDL( applsys_schema
577: , 'PJM'
578: , AD_DDL.DROP_SYNONYM
579: , 'DROP SYNONYM ' || X_synonym_name
580: , X_synonym_name );
581:
582: create_flag := 'Y';
588: END IF;
589: END IF;
590: IF ( create_flag = 'Y' ) THEN
591: sqlstmt := 'CREATE SYNONYM ' || X_synonym_name || ' FOR ' || X_table_name;
592: AD_DDL.DO_DDL( applsys_schema
593: , 'PJM'
594: , AD_DDL.CREATE_SYNONYM
595: , sqlstmt
596: , X_synonym_name );
590: IF ( create_flag = 'Y' ) THEN
591: sqlstmt := 'CREATE SYNONYM ' || X_synonym_name || ' FOR ' || X_table_name;
592: AD_DDL.DO_DDL( applsys_schema
593: , 'PJM'
594: , AD_DDL.CREATE_SYNONYM
595: , sqlstmt
596: , X_synonym_name );
597: synonym_changed := TRUE;
598: END IF;
641: --
642: -- Recompile the PA commitment view just as a housekeeping step
643: -- Do not worry about the outcome
644: --
645: AD_DDL.DO_DDL( applsys_schema
646: , 'PA'
647: , AD_DDL.ALTER_VIEW
648: , 'ALTER VIEW PA_COMMITMENT_TXNS_V COMPILE'
649: , 'PA_COMMITMENT_TXNS_V' );
643: -- Do not worry about the outcome
644: --
645: AD_DDL.DO_DDL( applsys_schema
646: , 'PA'
647: , AD_DDL.ALTER_VIEW
648: , 'ALTER VIEW PA_COMMITMENT_TXNS_V COMPILE'
649: , 'PA_COMMITMENT_TXNS_V' );
650: EXCEPTION
651: WHEN OTHERS THEN