372: close s;
373: --
374: -- Drop the view just in case
375: --
376: ad_ddl.do_ddl( applsys_schema
377: , 'PJM'
378: , ad_ddl.drop_view
379: , 'DROP VIEW ' || X_synonym_name
380: , X_synonym_name );
374: -- Drop the view just in case
375: --
376: ad_ddl.do_ddl( applsys_schema
377: , 'PJM'
378: , ad_ddl.drop_view
379: , 'DROP VIEW ' || X_synonym_name
380: , X_synonym_name );
381:
382: create_flag := 'Y';
386: --
387: -- Synonym exists but points to a different object. We need to drop
388: -- the existing synonym first before recreating the new one
389: --
390: ad_ddl.do_ddl( applsys_schema
391: , 'PJM'
392: , ad_ddl.drop_synonym
393: , 'DROP SYNONYM ' || X_synonym_name
394: , X_synonym_name );
388: -- the existing synonym first before recreating the new one
389: --
390: ad_ddl.do_ddl( applsys_schema
391: , 'PJM'
392: , ad_ddl.drop_synonym
393: , 'DROP SYNONYM ' || X_synonym_name
394: , X_synonym_name );
395: create_flag := 'Y';
396: else
401: end if;
402: end if;
403: if ( create_flag = 'Y' ) then
404: sqlstmt := 'CREATE SYNONYM ' || X_synonym_name || ' FOR ' || X_table_name;
405: ad_ddl.do_ddl( applsys_schema
406: , 'PJM'
407: , ad_ddl.create_synonym
408: , sqlstmt
409: , X_synonym_name );
403: if ( create_flag = 'Y' ) then
404: sqlstmt := 'CREATE SYNONYM ' || X_synonym_name || ' FOR ' || X_table_name;
405: ad_ddl.do_ddl( applsys_schema
406: , 'PJM'
407: , ad_ddl.create_synonym
408: , sqlstmt
409: , X_synonym_name );
410: end if;
411: end create_synonym;