Okay,

I'm having the same type of issue with SQLServer.  I've mucked around
with different combinations of delimiters but two statements in the
same file being executed against SQLServer seem to fail.

<FILE1:Which is successful>
create view dbo.t1_v1
as 
   select * from t1
go
</FILE1>

<FILE2:Which is unsuccessful>
create view dbo.t1_v2
as 
   select * from t1
go

create view dbo.t1_v3
as 
   select * from t1
go
</FILE2>

HERE IS A COPY OF THE RELEVANT OUTPUT:

      [sql] Executing file: 
C:\fmer\dbms_proto\sqlserver\reportplace\views\t1_v1.sql
      [sql] 0 rows affected
      [sql] Executing file: 
C:\fmer\dbms_proto\sqlserver\reportplace\views\t1_v2.sql
      [sql] Failed to execute: 
      [sql] create view dbo.t1_v2
      [sql] as 
      [sql]    select * from t1
      [sql] go
      [sql] 
      [sql] create view dbo.t1_v3
      [sql] as 
      [sql]    select * from t1
      [sql] go

BUILD FAILED
C:\fmer\dbmsbin\dbmsbin.xml:170: The following error occurred while executing 
this line:
C:\fmer\dbmsbin\dbmsbin.xml:166: The following error occurred while executing 
this line:
C:\fmer\dbmsbin\dbmsbin.xml:105: java.sql.SQLException: [Microsoft][SQLServer 
2000 Driver for JDBC][SQLServer]Incorrect syntax near the keyword 'create'.

Also, notice that I left the SQLServer style delimiter of "go" inside the files.

Is there something I'm missing from the SQLServer end?

Thanks.

-- 
Galen Boyer


    "Velagapudi, Murali" <[EMAIL PROTECTED]> writes:

    > try with  delimiter="/" and replace ; with /
    > it works fine for me on oracle.
    > 
    > thanks,
    > Murali
    > 
    > -----Original Message-----
    > From: news [mailto:[EMAIL PROTECTED] Behalf Of
    > [EMAIL PROTECTED]
    > Sent: Thursday, December 30, 2004 1:52 PM
    > To: user@ant.apache.org
    > Subject: SQL task and the delimiter and 1.6.2.
    > 
    > 
    > I'm having trouble getting more than one statement withing a file to
    > execute successfully.  I'm pretty sure it has to do with the
    > delimiter.  I am using 1.6.2.
    > 
    > For my sql task, I have the delimiter attribute set to ";"
    > 
    > HERE I AM GOING AGAINST ORACLE:
    > 
    > <<FileToExec>>
    > create or replace view t1_v1
    > as 
    >    select * from t1
    > ;
    > 
    > create or replace view t1_v3
    > as 
    >    select * from t1
    > ;
    > <</FileToExec>>
    > 
    > I get the error:
    > 
    > BUILD FAILED
    > C:\fmer\dbmsbin\dbmsbin.xml:170: The following error occurred while 
executing this line:
    > C:\fmer\dbmsbin\dbmsbin.xml:166: The following error occurred while 
executing this line:
    > C:\fmer\dbmsbin\dbmsbin.xml:105: java.sql.SQLException: ORA-00911: 
invalid character
    > 
    > IF I CHANGE IT SO I HAVE ONLY ONE STATEMENT:
    > 
    > <<FileToExec>>
    > create or replace view t1_v1
    > as 
    >    select * from t1
    > <</FileToExec>>
    > 
    > I then get success.  
    > 
    > Notice that I also needed to remove the ";" within
    > even the file with only one SQL statement.
    > 
    > I have seen this work on other versions of ant, but seems to be giving
    > me fits with the 1.6.2 version.  Am I just missing something silly?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to