Execute the Oracle stored procedure in Ant

Source: Internet
Author: User

The same Oracle dll script:

  1. DeclareCInt;Begin
  2. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Activestarttimes'); If c = 1Then ExecuteImmediate'Drop table "ACTIVESTARTTIMES" cascade constraints'; C: = 0;EndIf;
  3. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Baseeventformat _ classifiers'); If c = 1Then ExecuteImmediate'Drop table "BASEEVENTFORMAT_CLASSIFIERS" cascade constraints'; C: = 0;EndIf;
  4. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Baseeventformat _ payloadkids'); If c = 1Then ExecuteImmediate'Drop table "BASEEVENTFORMAT_PAYLOADIDS" cascade constraints'; C: = 0;EndIf;
  5. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Baseeventformat'); If c = 1Then ExecuteImmediate'Drop table "BASEEVENTFORMAT" cascade constraints'; C: = 0;EndIf;
  6. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Classifierbefmap'); If c = 1Then ExecuteImmediate'Drop table "CLASSIFIERBEFMAP" cascade constraints'; C: = 0;EndIf;
  7. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Classifiergroups'); If c = 1Then ExecuteImmediate'Drop table "CLASSIFIERGROUPS" cascade constraints'; C: = 0;EndIf;
  8. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Classifier'); If c = 1Then ExecuteImmediate'Drop table "CLASSIFIER" cascade constraints'; C: = 0;EndIf;
  9. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Clquerymodel'); If c = 1Then ExecuteImmediate'Drop table "CLQUERYMODEL" cascade constraints'; C: = 0;EndIf;
  10. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Ecompid'); If c = 1Then ExecuteImmediate'Drop table "ECOMPID" cascade constraints'; C: = 0;EndIf;
  11. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Lggingpolicymessage _ properties'); If c = 1Then ExecuteImmediate'Drop table "LGGINGPOLICYMESSAGE_PROPERTIES" cascade constraints'; C: = 0;EndIf;
  12. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Loggingpolicymessage'); If c = 1Then ExecuteImmediate'Drop table "LOGGINGPOLICYMESSAGE" cascade constraints'; C: = 0;EndIf;
  13. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Loggingpolicymodel _ MESSAGES'); If c = 1Then ExecuteImmediate'Drop table "LOGGINGPOLICYMODEL_MESSAGES" cascade constraints'; C: = 0;EndIf;
  14. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Loggingpolicyproperties'); If c = 1Then ExecuteImmediate'Drop table "LOGGINGPOLICYPROPERTY" cascade constraints'; C: = 0;EndIf;
  15. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Logservice'); If c = 1Then ExecuteImmediate'Drop table "LOGSERVICE" cascade constraints'; C: = 0;EndIf;
  16. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Othersituation _ any'); If c = 1Then ExecuteImmediate'Drop table "OTHERSITUATION_ANY" cascade constraints'; C: = 0;EndIf;
  17. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Payloaddata'); If c = 1Then ExecuteImmediate'Drop table "PAYLOADDATA" cascade constraints'; C: = 0;EndIf;
  18. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Payload'); If c = 1Then ExecuteImmediate'Drop table "PAYLOAD" cascade constraints'; C: = 0;EndIf;
  19. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Reportingcomponentid'); If c = 1Then ExecuteImmediate'Drop table "REPORTINGCOMPONENTID" cascade constraints'; C: = 0;EndIf;
  20. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Situationtype'); If c = 1Then ExecuteImmediate'Drop table "SITUATIONTYPE" cascade constraints'; C: = 0;EndIf;
  21. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Statsclassifiers'); If c = 1Then ExecuteImmediate'Drop table "STATSCLASSIFIERS" cascade constraints'; C: = 0;EndIf;
  22. Select Count(*)IntoCFromUser_tablesWhereTable_name =Upper('Statsclassifiers'); If c = 1Then ExecuteImmediate'Drop table "STATSCLASSIFIERS" cascade constraints'; C: = 0;EndIf;
  23. End;

The following error occurs when running in Ant:

06/08/12 14:22:59. 800 INFO: [ProcessWrapper] [STDOUT] cleanup. db. logging:
06/08/12 14:23:00. 232 INFO: [ProcessWrapper] [STDOUT] [SQL] Executing resource:/root/installation/DSEngine/work/silver-ion-ui-1/scripts/cleanupDDL/oracle/drop_commonlogging.ddl
06/08/12 14:23:00. 247 INFO: [ProcessWrapper] [STDERR] [SQL] Failed to execute: 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
06/08/12 14:23:00. 267 INFO: [ProcessWrapper] [STDERR]
06/08/12 14:23:00. 268 INFO: [ProcessWrapper] [STDERR] BUILD FAILED
06/08/12 14:23:00. 268 INFO: [ProcessWrapper] [STDERR] java. SQL. SQLException: ORA-06550: line 1, column 201:
06/08/12 14:23:00. 268 INFO: [ProcessWrapper] [STDERR] PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
06/08/12 14:23:00. 268 INFO: [ProcessWrapper] [STDERR]
06/08/12 14:23:00. 268 INFO: [ProcessWrapper] [STDERR];

From the error point of view, there is no ';' at the end of a line, but check that there are ';' At the end of each line and the end of the file. There is no problem to put the script in DbVisualizer for execution, but why can't I find it when running it in Ant?

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.