日期:2014-05-16  浏览次数:20574 次

Ant中执行oracle存储过程
同样的oracle dll脚本:

declare c int; begin
select count(*) into c from user_tables where table_name = upper('ACTIVESTARTTIMES');if c = 1 then execute immediate 'drop table "ACTIVESTARTTIMES" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('BASEEVENTFORMAT_CLASSIFIERS');if c = 1 then execute immediate 'drop table "BASEEVENTFORMAT_CLASSIFIERS" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('BASEEVENTFORMAT_PAYLOADIDS');if c = 1 then execute immediate 'drop table "BASEEVENTFORMAT_PAYLOADIDS" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('BASEEVENTFORMAT');if c = 1 then execute immediate 'drop table "BASEEVENTFORMAT" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('CLASSIFIERBEFMAP');if c = 1 then execute immediate 'drop table "CLASSIFIERBEFMAP" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('CLASSIFIERGROUPS');if c = 1 then execute immediate 'drop table "CLASSIFIERGROUPS" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('CLASSIFIER');if c = 1 then execute immediate 'drop table "CLASSIFIER" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('CLQUERYMODEL');if c = 1 then execute immediate 'drop table "CLQUERYMODEL" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('ECOMPID');if c = 1 then execute immediate 'drop table "ECOMPID" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('LGGINGPOLICYMESSAGE_PROPERTIES');if c = 1 then execute immediate 'drop table "LGGINGPOLICYMESSAGE_PROPERTIES" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('LOGGINGPOLICYMESSAGE');if c = 1 then execute immediate 'drop table "LOGGINGPOLICYMESSAGE" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('LOGGINGPOLICYMODEL_MESSAGES');if c = 1 then execute immediate 'drop table "LOGGINGPOLICYMODEL_MESSAGES" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('LOGGINGPOLICYPROPERTY');if c = 1 then execute immediate 'drop table "LOGGINGPOLICYPROPERTY" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('LOGSERVICE');if c = 1 then execute immediate 'drop table "LOGSERVICE" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('OTHERSITUATION_ANY');if c = 1 then execute immediate 'drop table "OTHERSITUATION_ANY" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('PAYLOADDATA');if c = 1 then execute immediate 'drop table "PAYLOADDATA" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('PAYLOAD');if c = 1 then execute immediate 'drop table "PAYLOAD" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('REPORTINGCOMPONENTID');if c = 1 then execute immediate 'drop table "REPORTINGCOMPONENTID" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('SITUATIONTYPE');if c = 1 then execute immediate 'drop table "SITUATIONTYPE" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('STATSCLASSIFIERS');if c = 1 then execute immediate 'drop table "STATSCLASSIFIERS" cascade constraints';c:=0;end if;
select count(*) into c from user_tables where table_name = upper('STATSCLASSIFIERS');if c = 1 then execute immediate 'drop table "STATSCLASSIFIERS" cascade constraints';c:=0;end if;
end;


在Ant中运行出现错误如下