Hi Rob, I have written a task (based on the SQL task) for loading from file and then compiling Oracle PL/SQL stored procedures and packages. One thing I found I had to do was disable escape processing for the load with:
statement = conn.createStatement(); statement.setEscapeProcessing(false); Without this any '&' characters in the stored procedures caused the load to fail. You could of course just remove them. Chris -----Original Message----- From: Anderson, Rob H - VSCM [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 8 January 2003 7:23 a.m. To: 'Ant Users List' Subject: RE: Writing a DB2 Java Stored Procedure compiling task I would think you could deploy a package or stored procedure with the sql task, but it does not appear to be the case. I get an error message that says: BUILD FAILED file:C:/cygwin/home/rhanderson/work/build_lib.xml:51: java.sql.SQLException: ORA-00900: invalid SQL statement Normally we run sqlplus to load the code as follows: sqlplus user/pass@database @package_body.sql -----Original Message----- From: Antoine Levy-Lambert [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 9:24 AM To: Ant Users List Subject: Re: Writing a DB2 Java Stored Procedure compiling task Deploying stored proc should be possible with the ant SQL task. Antoine ----- Original Message ----- From: "Anderson, Rob H - VSCM" <[EMAIL PROTECTED]> To: "'Ant Users List'" <[EMAIL PROTECTED]> Sent: Tuesday, January 07, 2003 6:00 PM Subject: RE: Writing a DB2 Java Stored Procedure compiling task > Hien, I deploy stored procedures to Oracle, but not with ant. There is > no ant task that I know of for deploying packages and procedures, but > it would > be great if there was. > > -Rob Anderson > > -----Original Message----- > From: Hien Q. Nguyen [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 07, 2003 6:44 AM > To: Ant Users List > Subject: RE: Writing a DB2 Java Stored Procedure compiling task > > > > Hi Kola, > I'm aware of the sql task but what I meant was a task to compile a > SQLJ JAVA > STORED PROCEDURE > Here is an example Java stored proc: > package javastoredproc; > #sql iterator MyIter ( int, int ); > public class MyJavaStoredProc > { > public static void myJavaStoredProc( ResultSet rs[] ) throws > SQLException, Exception > { > MyIter myIter=null; > #sql myIter= > { > select columnA, columnB from some_table > }; > file://...bla..bla..bla... > } > } > In DB2, the compilation steps are: > 1. First the source is process by sqlj (a db2 utility) to generate > the appropriate code 2. javac on genrated code > 3. db2profc (a db2 utility for profiling the sqlj stored proc.) > 4. now the create stored proc statement, i.e. > CREATE PROCEDURE HIEN.MYJAVASTOREDPROC ( ) > EXTERNAL NAME > '"HIEN".MYJAVASTOREDPROC:javastoredproc.MyJavaStoredProc.myJavaStoredPro c > SPECIFIC HIEN.MYJAVASTOREDPROC > RESULT SETS 0 > LANGUAGE JAVA > PARAMETER STYLE JAVA > NOT DETERMINISTIC > FENCED NO > DBINFO NULL > CALL MODIFIES SQL DATA > ; > Does anybody use sqlj stored. procedure? Its available in Oracle, DB2, & > Sybase(?) > Thanks, > --Hien > "Fajimolu, Kola" <[EMAIL PROTECTED]> wrote:Hi > > Happy New Year to All > This book has a section on creating a database using ant. > It uses the Ant sql task to create a DB and insert data. Through the > examples given I think you will be able to create your stored > procedures. You could download the source code for the book for > example of ??? > > http://www.amazon.com/exec/obidos/tg/detail/-/047120708X/104-2318894-588 1526 > ?vi=glance > > > KolaF > > > -----Original Message----- > > From: "Antoine Levy-Lambert" > > @MCGRAW-HILL > > Sent: Tuesday, January 07, 2003 8:11 AM > > To: Ant Users List > > Subject: Re: Writing a DB2 Java Stored Procedure compiling task > > > > > > There is a SQL task in ant, which requires a JDBC driver. If you are using > > a > > JDBC driver for DB2, and > > the JDBC driver supports the creation of stored procedures, you can create > > your stored procs with ant. > > Antoine > > ----- Original Message ----- > > From: "Hien Q. Nguyen" > > To: > > Sent: Tuesday, January 07, 2003 5:58 AM > > Subject: Writing a DB2 Java Stored Procedure compiling task > > > > > > > Hi, > > > > > > I want to use Ant to build our back end DB2 Java > > > Stored Procedures and I've searched the list and > > > looked around the website but couldn't find anything. > > > I'm wondering if anybody has done/wanted such a task. > > > If not I'd like to write one and share with the community. Any > > > comments, suggestions are greatly appreciated. > > > > > > Thanks, > > > --Hien > > > > > > __________________________________________________ > > > Do you Yahoo!? > > > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > > > http://mailplus.yahoo.com > > > > > > -- > > > To unsubscribe, e-mail: > > > > > For additional commands, e-mail: > > > > > > > > > > > -- > > To unsubscribe, e-mail: > > For additional commands, e-mail: > > > > > > ATTACHMENT part 2 application/ms-tnef -- > To unsubscribe, e-mail: > For additional commands, e-mail: > > . . . . . . > [EMAIL PROTECTED] > > "Give me a lever and a fulcrum, and I can move the globe." > --Archimedes > > > --------------------------------- > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>