ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ray Wiggins" <ray.wigg...@swingvote.com>
Subject RE: How do you set SQL Server 2005 database options with iBATIS?
Date Thu, 07 Feb 2008 18:12:59 GMT
Thanks!  I had a typo in one of the SET statements which caused my query
to fail.

 

BTW, I am using includes for the SET statements:

 

  <statements>

    <!-- This SQL fragment sets database options -->

    <sql id="DatabaseOptions">

      SET NOCOUNT ON;

      SET ANSI_NULL_DFLT_ON ON;

      SET CONCAT_NULL_YIELDS_NULL ON;

      SET ANSI_NULLS ON;

      SET ANSI_PADDING ON;

      SET ANSI_WARNINGS ON;

      SET ARITHABORT ON;

      SET CONCAT_NULL_YIELDS_NULL ON;

      SET QUOTED_IDENTIFIER ON;

      SET NUMERIC_ROUNDABORT OFF;

    </sql>

  </statements>

 

  <select id= . . .>

    <include refid="DatabaseOptions"/>

    SELECT . . .

________________________________

From: Tony Johnson [mailto:listAccount@deepcode.co.uk] 
Sent: Thursday, February 07, 2008 11:13 AM
To: user-cs@ibatis.apache.org
Subject: RE: How do you set SQL Server 2005 database options with
iBATIS?

 

Can you not just add that as part of your SQL statement? Eg:

 

<select.....>

      SET NOCOUNT ON;

      SET ANSI_NULL_DFLT_ON ON;

      SET CONCAT_NULL_YIELDS_NULL ON;

      SET ANSI_NULLS ON;

      SELECT field1, field2 FROM myTable ORDER BY field1


</select>

 

You could also look at the extends attribute or the include element to
bring the same SET's into each query....

 

Cheers

Tony

 

From: Ray Wiggins [mailto:ray.wiggins@swingvote.com] 
Sent: 07 February 2008 15:25
To: user-cs@ibatis.apache.org
Subject: How do you set SQL Server 2005 database options with iBATIS?

 

How do you set SQL Server 2005 database options prior to executing a
query with iBATIS?

 

e.g.

      SET NOCOUNT ON;

      SET ANSI_NULL_DFLT_ON ON;

      SET CONCAT_NULL_YIELDS_NULL ON;

      SET ANSI_NULLS ON;

 


Mime
View raw message