ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chaohua Wang" <>
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


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.


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

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

View raw message