• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

SQL

 
James Daniel
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Jim
 
Jeanne Boyarsky
author & internet detective
Posts: 41184
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jim,
If you don't find a PLSQL task, you can always call TOAD through an OS script. Which Ant can call using the exec task.
 
Frank Carver
Sheriff
Posts: 6965
2
Eclipse IDE Debian Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
James Daniel
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tried a plain vanilla Ant call of SQL script. I do see that a "keepformat" switch. I will try that.
 
James Daniel
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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;

Exception thrown:

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)
reply
    Bookmark Topic Watch Topic
  • New Topic