ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack J. Woehr" <>
Subject Re: Sql Task -- quote marks
Date Tue, 06 Apr 2004 14:52:33 GMT
Stefan Bodewig wrote:

> It will start with SQL: at some point and everything after that is the
> literal String passed to Statement#execute.  Since the piece you've
> pasted does not start with "SQL:" on each line, Ant has joined several
> lines to build a single statement.

Okay, here it is:

      [sql] SQL:
      [sql] CREATE PROCEDURE sp_drop_constraints AS
      [sql] begin
      [sql]   declare @outstring varchar(200),@tmptablename varchar(200),@constraintname varchar(200),@querystring
varchar(200),@i int,@rows int
      [sql]   create table #temp_constrain (
      [sql]       id numeric(7,0) identity,
      [sql]       tablename varchar(200),
      [sql]       constraintname varchar(200)
      [sql]    )
      [sql]   insert into #temp_constrain select, from sysconstraints sc,sysobjects
so,sysconstraints sc1,sysobjects so1 where = sc.tableid and = sc1.constrid and
sc.constrid =
      [sql]   select @i=1
      [sql]   select @rows = count(*) from #temp_constrain
      [sql]   while @i <= @rows
      [sql]     begin
      [sql]         select @tmptablename = tablename from #temp_constrain where id = @i
      [sql]         select @constraintname = constraintname from #temp_constrain where id
= @i
      [sql]     select @querystring = "alter table " +  @tmptablename + " drop constraint
" + @constraintname
      [sql]         print @querystring
      [sql]         exec(@querystring)
      [sql]         select @i=@i+1
      [sql]     end
      [sql] end
      [sql] Failed to execute:
    ....... repeats the statement ...
      [sql] com.sybase.jdbc2.jdbc.SybSQLException: Invalid column name ' drop constraint '.
      [sql] 1 of 2 SQL statements executed successfully
      [antcall] Exiting /usr/local/work/jax/jazmin/build/reloadDB.xml.
      [ant] Exiting /usr/local/work/jax/jazmin/build/reloadDB.xml.

But like I said, all this doesn't prove to me exactly what's happening in the JDBC call. The
statement is
valid, the statement works correctly in ISQL, yet the statement is failing in the Ant Sql
task. Either it's Sybase
or it's Sybase's JDBC driver or it's Ant. I don't have enough evidence to exculpate any component
in the chain yet.

Since I had seen complaints about the Sql task elsewhere on the Web I had hoped there was
some information
in the community on this sort of problem, but I guess that I get to be the pioneer! :-)

Jack J. Woehr      # We have gone from the horse and buggy
Senior Consultant  # to the moon rocket in one lifetime, but
Purematrix, Inc.   # there has not been a corresponding moral # growth in mankind. - Dwight D. Eisenhower

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message