This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I am trying to run Oracle SQL scripts via Ant. Everything works fine if they are plain SQL commands. If, the script includes both PLSQL and SQL commands, the script fails. The script runs fine in Toad. I assume Toad has a parser that differentiates between SQL and PLSQL. Has anyone heard of a way to mimic what Toad does in Ant? Any help would be greatly appreciated.
Presumably your complex scripts consist of multiple statements on multiple lines. The Ant SQL Task has a bunch of optional configurations to do with processing of separators and (re)formatting of scripts - can you give us any more details on which options you have tried? [ January 10, 2007: Message edited by: Frank Carver ]
I have tried a plain vanilla Ant call of SQL script. I do see that a "keepformat" switch. I will try that.
Joined: Sep 24, 2004
I am still getting the error. Plain SQL scripts work but PLSQL fail.
Script I am trying to run:
begin select count(*) from abc; end;
java.sql.SQLException: ORA-06550: line 3, column 33: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ;
at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:398) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) at org.apache.tools.ant.Project.executeTarget(Project.java:1185) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) at org.apache.tools.ant.Project.executeTargets(Project.java:1068) at org.apache.tools.ant.Main.runBuild(Main.java:668) at org.apache.tools.ant.Main.startAnt(Main.java:187) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)