How can you put batch using Groovy SQL while simulating the completed statement? I found that all the examples are like the following and do not use the prepared statement.
withBatch {stmt -> Stmt.addBatch value ('value1', 'value2') values ('value1', field 2) values ('value3', 'value4') "(insert table (field 1, field 2) ) Stmt.addBatch}
According to this link, there is no way to directly use the statement prepared from within the batch. This is the best way to emulate, so I Can I avoid writing my code to avoid it?
Groove 1.8.1 prepared with batching Simple example:
sql.withBatch (20, "update some_ table some_column =: newvalue where id =: key" "") {ps - & gt; Mymap. Each {k, v - & gt; Ps.addBatch (key: k, newvalue: v)}}
Also see my post on this topic:
Comments
Post a Comment