Browse Source

Allow the SQL Delimiter to be set so that Oracle stored procs may be

entered.

Submitted by:	Mike Williams <mikew@cortexebusiness.com.au>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269022 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 24 years ago
parent
commit
64d3b161d2
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      src/main/org/apache/tools/ant/taskdefs/SQLExec.java

+ 13
- 1
src/main/org/apache/tools/ant/taskdefs/SQLExec.java View File

@@ -131,6 +131,11 @@ public class SQLExec extends Task {
*/
private Vector transactions = new Vector();

/**
* SQL Statement delimiter
*/
private String delimiter = ";";
/**
* Print SQL results.
*/
@@ -247,6 +252,13 @@ public class SQLExec extends Task {
this.autocommit = autocommit;
}

/**
* Set the statement delimiter.
*/
public void setDelimiter(String delimiter) {
this.delimiter = delimiter;
}

/**
* Set the print flag.
*/
@@ -441,7 +453,7 @@ public class SQLExec extends Task {
// so we cannot just remove it, instead we must end it
if (line.indexOf("--") >= 0) sql += "\n";

if (sql.endsWith(";")){
if (sql.endsWith(delimiter)){
log("SQL: " + sql, Project.MSG_VERBOSE);
execSQL(sql.substring(0, sql.length()-1), out);
sql = "";


Loading…
Cancel
Save