-
I have an application running multiples threads to consume messages from a RabbitMQ queue and using the BulkInsert method to insert 1000 rows in Oracle database. |
Beta Was this translation helpful? Give feedback.
Answered by
sijms
Jul 29, 2023
Replies: 1 comment
-
BulkInsert now can run from inside sql.Exec() just pass an arrays. you can review example merge/main.go // all arrays should be same size
_, err := conn.Exec(sqlText, // sql text INSERT INTO OR MERGE INTO
sql.Named("ID", ids), // array of integers
sql.Named("NAME", names), // array of string
sql.Named("VAL", vals), // array of float
sql.Named("LDATE", dates)) // array of time.Time |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gexcode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BulkInsert now can run from inside sql.Exec() just pass an arrays. you can review example merge/main.go
this is a code example