ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chaohua Wang" <cw...@incomm.com>
Subject ant sql call stored procedure
Date Thu, 13 Mar 2008 17:15:21 GMT
Hi folks, 


I am using ant sql to call a stored procedure of Ms Sql server

<sql
    driver="${jdbcdriver}"
    url="${dburl}/BillPay"
    userid="${userid}"
    password="${password}"
	src="selectCount.sql"
	classpathref="webtest.path.id"
>
	</sql> 	


I can execute stored procedure in Ms Sql server. My stored procedure name is uspSelectCount.
Then I use Execute--> File to generate a file called selectCount.sql.  But when I am using
ant sql to call the file selectCount.sql that is located with the build file. 

I always got this exception: 
      [sql] Executing file: C:\workspace\billPay\tests\selectCount.sql
      [sql] Failed to execute:   ■U S E   [ B i l l P a y ]  G O  D E C L A R E       
  @ r e t u r n _ v a l u e   i n t  E X E C      @ r e t u r n _ v a l u e   =   [ d b o
] . [ u s p S e l e c t
 C o u n t ]  S E L E C T        ' R e t u r n   V a l u e '   =   @ r e t u r n _ v a l u
e  G O
      [sql] java.sql.SQLException: Incorrect syntax near 'E'.

'E' is the third character of USE. I am not sure the reason why? Please help.

cwang



This is selectCount.sql file 
---------------------------------
USE [BillPay]
GO
DECLARE	@return_value int
EXEC	@return_value = [dbo].[uspSelectCount]
SELECT	'Return Value' = @return_value
GO
--------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message