|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
batch insertsDoes anyone know if there is a way to do batch inserts with iBatis for .NET?
-- Ben Monro Software Developer |
|
|
Re: batch insertsIn ADO.NET there is no simple way to do batch statement in a db provider independent manner as in JBDC.
For now, I haven't think of a good solution to implement batch support in iBATIS.NET. Perhaps other people have some ideas ? If you use SQL Server you do that with a store procedure and an XML in parameter. -- Cheers, Gilles |
|
|
Re: batch insertsWell a couple things come to mind. One is to model the batch insert functionality after the way it works in iBatis for Java. If that doesnt work because of the ADO.NET restrictions then perhaps we could instead pass a collection of domain objects as a parameter to an insert query? Then ibatis would then iterate over the collectino and generate a single query?
The Stored procedure option sounds promising...
On Mon, Jun 30, 2008 at 12:43 PM, Gilles Bayon <ibatis.net@gmail.com> wrote: In ADO.NET there is no simple way to do batch statement in a db provider independent manner as in JBDC. -- Ben Monro Software Developer |
|
|
|
|
|
Re: batch insertsI know that but it's SQL Server only.
On Mon, Jun 30, 2008 at 11:15 PM, Ron Grabowski <rongrabowski@...> wrote:
|
|
|
Re: batch insertsif you are using Microsoft SQL Server as your database and intend not to change it for a long time, then you can use "SqlBulkCopy Class". This class helps in batch uploading of data into a database table.
The SqlBulkCopy class can be used to write data only to SQL Server tables. However, the data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a DataTable. Refer the following links: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx http://www.codeproject.com/KB/database/SqlBulkCopy.aspx If you come across a solution to this in iBatis.Net, please post a comment on it. =========================================================
|
|
|
Re: batch insertsThe link for 'SqlCommandSet.cs' has changed. See below:
http://rhino-tools.svn.sourceforge.net/viewvc/rhino-tools/trunk/commons/Rhino.Commons/ToPublic/SqlCommandSet.cs
|
|
|
Re: batch insertsThe exposed SqlCommandSet would definitely be a nice to have. However, I do see a problem with the license and being able to just drop it in the source for iBatis as its currently licensed. It could be wrapped as a third-party dll and reference that was as we currently do with the Castle dll's. But that would bring the number of DLL's up to 5
DataMapper,Common,Castle.Core,Castle.DynamicProxy2,Rhino.Commons.Clr thoughts? On Thu, Nov 5, 2009 at 2:05 AM, vinay.a <vinay_onmail@...> wrote:
-- Michael J. McCurrey Read with me at http://www.mccurrey.com http://chaoticmindramblings.blogspot.com/ |
|
|
Re: batch insertsHi all, can we use sql fragments as some sort of function? Is there a way to pass "parameters" to an sql fragment. My need is something like this (within one sql):
fragment1(parameter1) union fragment1(parameter2) Or probably there is another way to achieve the same thing in ibatis? My intention is to simplify the application codes while at the same time I do not want to create functions in the DBMS. Hope I made my self clear.
TIA, Panji On Thu, Nov 5, 2009 at 9:23 PM, Michael McCurrey <mmccurrey@...> wrote: The exposed SqlCommandSet would definitely be a nice to have. However, I do see a problem with the license and being able to just drop it in the source for iBatis as its currently licensed. It could be wrapped as a third-party dll and reference that was as we currently do with the Castle dll's. But that would bring the number of DLL's up to 5 |
| Free embeddable forum powered by Nabble | Forum Help |