I have an application that inserts rows into an Oracle DB using ODBC (Setup in ODBCAdministrator), currently it binds the parameters and does the insert one row at a time. This generally works fine, but sometimes when there are a lot of rows and the db is non-local network overhead becomes a slowdown.

I was thinking if I could insert multiple rows at a time I could cut down on that.

Looking here, it seems ODBC should support that https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/using-arrays-of-parameters?view=sql-server-ver15

To use arrays of parameters, the application calls SQLSetStmtAttr with an Attribute argument of SQL_ATTR_PARAMSET_SIZE to specify the number of sets of parameters.

I’m not seeing how to set that in the .net world, nor does just setting my params to arrays work.

Maybe I need to cast/convert the ODBC connection to something else?

Anonymous Asked question May 13, 2021