ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zsolt" <zkoppanyl...@intland.com>
Subject RE: Bulk inserts
Date Thu, 03 Nov 2005 14:20:43 GMT
Paul,

How does it compare to batch processing?

Zsolt

>-----Original Message-----
>From: Paul Benedict [mailto:paul4christ79@yahoo.com]
>Sent: Thursday, November 03, 2005 8:44 AM
>To: user-java@ibatis.apache.org
>Subject: Re: Bulk inserts
>
>Yes,
>
>SQL has a notation to INSERT multiple entries at once.
>What you want to do is build a statement like the
>following:
>
>INSERT INTO fruit (id, name) VALUES (0, 'Pear'), (1,
>'Apple'), (2, 'Peach')
>
>Use the <iterate> tag to build the dynamic list at the
>end. In this example, the GroceryBag object has a
>property of Fruit[] called fruits:
>
><insert id="insertFruit" parameterClass="GroceryBag">
>  INSERT INTO fruit
>    (id, name)
>  VALUES
>  <iterate property="fruits" conjunction=",">
>    (#fruits[].id#, #fruits[].name#)
>  </iterate>
></insert>
>
>
>
>
>__________________________________
>Yahoo! FareChase: Search multiple travel sites in one click.
>http://farechase.yahoo.com


Mime
View raw message