Hi
PFB my code snippet

dataContext.executeUpdate(new UpdateScript() {

        def run(callback: UpdateCallback): Unit = {


          val table: Table = schema.getTableByName(tablename)

         for(i =1;i< n ;i ++){
          callback.insertInto(table).value(columns, value)
            .value(column, value)
            .execute()
        }
}
      }
      )

On Fri, Feb 5, 2016 at 12:23 AM, Kasper Sørensen <
[email protected]> wrote:

> Hi Arun,
>
> It depends on where your loop is... Can you share a code snippet?
>
> Basically the loop should be inside an UpdateScript - then everything is
> happening in one big bulk/transaction. If the loop is outside then you're
> likely to suffer under a very chatty (and non-transactional) interaction
> with the DB.
>
> Kasper
>
> 2016-02-04 5:22 GMT+01:00 Arunkumar Pillai <[email protected]>:
>
> > Hi
> >
> > Do we have any better way to insert multiple records together. current
> i'm
> > using loop?
> > Please suggest if there any better ways
> >
> > --
> > Thanks and Regards
> >         Arun
> >
>



-- 
Thanks and Regards
        Arun

Reply via email to