Hi Daniel 2017-05-29 19:30 GMT+02:00 Daniel Einspanjer <[email protected] >:
> I did notice the .set() variant, but because the JavaDoc or the manual > specifically mentioned that it came out of MySQL, I wasn't sure if it would > work as desired for Postgres. > Thanks for the pointer. Hmm, indeed - we should improve that manual section to be clear that the clause is being emulated for other dialects. > So if I used: > stmt = insertInto(TABLE).columns(X,Y,Z); > records.forEach(record -> stmt.set(record)); > stmt.execute(); > Don't forget to call stmt.newRecord() in between. > Would it pick out only the columns that I specified from the collection of > records that was passed in? > Yes, indeed. > Is it any improvement over the same code with stmt.values(r.getX(), > r.getY(), r.getZ()) instead? > Yes, if you're passing in only a few columns, there's a lot less to write and no risk of messing up the order of columns... Hope this helps, Lukas -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
