当前位置: 代码迷 >> SQL >> plsql块施行ddl语句
  详细解决方案

plsql块施行ddl语句

热度:8   发布时间:2016-05-05 12:58:46.0
plsql块执行ddl语句

?

学习:

http://www.cnblogs.com/huanghai223/archive/2011/06/29/2093660.html

?

declare

? v_count integer := 0;

begin

? select count(1) into v_count from user_constraints where constraint_name = 'SYS_C008270';

? if (v_count > 0) then

? ? --prd

? ? execute immediate 'alter table tfz_grade_detail_rec_his drop constraint SYS_C008270';

? else

? ? --stg

? ? execute immediate 'alter table tfz_grade_detail_rec_his drop constraint SYS_C008170';

? end if;

end;


  相关解决方案