I'm sorry for the late reply. We're in a crunch before a release so we're not paying as much attention to our emails as we should. Edmund Dengler wrote:
Greetings!
Does anybody have any working example code using mapi_prepare/map_prepare_array/mapi_execute_array showing the use of a prepare along with array substitution?
The only example of mapi_prepare* that I know of is in the MonetDB ODBC driver sql/src/odbc/driver/SQLPrepare.c. There the call mapi_prepare_handle is used to prepare a SQL statement, and in SQLExecute.c there is a call to mapi_execute to execute the prepared query. Before the execute, the application can bind parameters with SQLBindParameter which calls mapi_param_type or mapi_param_string.
I can get a sample piece working using mapi_execute. Trying mapi_execute_array causes the test program to exit with an error code of 139 (the function does not seem to return, but causes an immediate exit). Using mapi_prepare/mapi_execute_array, the program runs, but nothing is changing in the database.
I don't think the array functions have actually ever been tested. It may well be that they cause a crash. Do you have some sample code that shows the crash?