ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chaohua Wang" <cw...@incomm.com>
Subject RE: ant sql call stored procedure
Date Wed, 19 Mar 2008 22:45:51 GMT
Thank you very much for your help. 

-----Original Message-----
From: Anderson, Rob (Global Trade) [mailto:Rob.Anderson@nike.com] 
Sent: Wednesday, March 19, 2008 12:30 PM
To: Ant Users List
Subject: RE: ant sql call stored procedure

It looks like the sql you are trying to execute is vendor specific. Keep in mind that the
Ant sql task uses a jdbc connection, and cannot accommodate vendor specific statements that
may work fine in the vendor supplied client.

-Rob Anderson

-----Original Message-----
From: Chaohua Wang [mailto:cwang@incomm.com] 
Sent: Monday, March 17, 2008 9:23 AM
To: Ant Users List; olivier.gies@bull.net
Subject: RE: ant sql call stored procedure


Hi, 

Thank you for your suggestion. But I used UTF-8, 
It changed a little bit, still can not get through.

  [sql] Executing file: C:\workspace\Canoo\billPay\tests\uspSelectCount.sql
  [sql] Failed to execute:  ?USE [BillPay] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON
GO CREATE PROCEDURE [dbo].[uspSelectCount] AS BEGIN SET NOCOUNT ON; Select  count(*) from
dbo.Payments_S
ng;  End
  [sql] java.sql.SQLException: Incorrect syntax near '?'.



Actually, I have no "?" in my sql file. 



This my sql file:


USE [BillPay]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[uspSelectCount]
AS
BEGIN
	SET NOCOUNT ON;
Select  count(*)
from dbo.Payments_Staging;

End




-----Original Message-----
From: Olivier Gies [mailto:olivier.gies@bull.net] 
Sent: Sunday, March 16, 2008 8:02 PM
To: Ant Users List
Subject: Re: ant sql call stored procedure

Hi,

It looks like the SQL file is encoded in some version of Unicode (UTF-8 
or Unicode/UTF-16 ?), with each character using 2 bytes, and your <sql> 
task is loading it in ISO-8599 by default.

You should verify your source file format (using 'file' command on *nix 
systems, or any editing tool in Windows, e.g. UltraEdit32) and set the 
<sql> task's "encoding" attribute accordingly (see 
http://ant.apache.org/manual/CoreTasks/sql.html)

BR,
Olivier

-------- Original Message  --------
Subject: ant sql call stored procedure
From: Chaohua Wang <cwang@incomm.com>
To: Chaohua Wang <cwang@incomm.com>, Ant Users List <user@ant.apache.org>
Date: 14/03/2008 06:31

> 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=" uspSelectCount.sql "
> 	classpathref="webtest.path.id"
> 	</sql> 	
> 
> 
> I can execute stored procedure in Ms Sql server. My stored procedure name is uspSelectCount.
 But when I am using ant sql to call the file uspSelectCount.sql  that is located with the
build file. 
> 
> I always got this exception: 
> 
> test:
>       [sql] Executing file: C:\workspace\Canoo\billPay\tests\uspSelectCount.sql
>       [sql] Failed to execute:   ■U S E   [ B i l l P a y ]  G O  / * * * * * *   O
b j e c t :     S t o r e d P r o c e d u r e   [ d b o ] . [ u s p S e l e c t C o u n t
]         S c r i p t   D
> a t e :   0 3 / 1 3 / 2 0 0 8   1 5 : 5 1 : 1 3   * * * * * *
>       [sql] java.sql.SQLException: Incorrect syntax near 'E'.
>       [sql] Failed to execute:   S E T   A N S I _ N U L L S   O N  G O  S E T   Q U
O T E D _ I D E N T I F I E R   O N  G O  - -   = = = = = = = = = = = = = = = = = = = = =
= = = = = = = = = = = = =
>  = = = = = = = = = = =  - -   A u t h o r :              < A u t h o r , , N a m e
>  - -   C r e a t e   d a t e :   < C r e a t e   D a t e , , >  - -   D e s c r
i p t i o n :       < D e s c r i p
>  t i o n , , >  - -   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = = = = = = = = = = = = =  C R E A T E   P R O C E D U R E   [ d b o ] . [ u s p S e l
e c t C o u n t ]    A S  B
>  E G I N  - -   S E T   N O C O U N T   O N   a d d e d   t o   p r e v e n t   e x t
r a   r e s u l t   s e t s   f r o m  - -   i n t e r f e r i n g   w i t h   S E L E C T
  s t a t e m e n t s .
>   S E T   N O C O U N T   O N ;    S e l e c t     c o u n t ( * )  f r o m   d b o .
P a y m e n t s _ S t a g i n g    E n d
>      [sql] java.sql.SQLException: Incorrect syntax near 'T'.
> 
> 
> 'E' is the third character of USE. 'T' is the third character of SET. I am not sure the
reason why? Please help.
> 
> I can execute  uspSelectCount.sql in the SQLunit.  <stmt>{call uspSelectCount()}</stmt>
> 
> cwang
> 
> 
> 
> This is uspSelectCount.sql file 
> --------------------------------------------
> USE [BillPay]
> GO
> /****** Object:  StoredProcedure [dbo].[uspSelectCount]    Script Date: 03/13/2008 15:51:13
******/
> SET ANSI_NULLS ON
> GO
> SET QUOTED_IDENTIFIER ON
> GO
> -- =============================================
> -- Author:		<Author,,Name>
> -- Create date: <Create Date,,>
> -- Description:	<Description,,>
> -- =============================================
> CREATE PROCEDURE [dbo].[uspSelectCount]
> 
> AS
> BEGIN
> 	-- SET NOCOUNT ON added to prevent extra result sets from
> 	-- interfering with SELECT statements.
> 	SET NOCOUNT ON;
> 
> Select  count(*)
> from dbo.Payments_Staging
> 
> End
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

-- 
*Olivier Gies*

*Delivery Manager
Customs & Tax Software Engineering Center
Bull, Architect of an Open World ^TM
Phone: +86 (10) 65978001 - Ext 555 *

*www.bull.com <http://www.bull.com/>*

*This e-mail contains material that is confidential for the sole use of
the intended recipient. Any review, reliance or distribution by others
or forwarding without express permission is strictly prohibited. If you
are not the intended recipient, please contact the sender and delete all
copies.*


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



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


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



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


Mime
View raw message