Sophis Risque: how to use the CSRSqlQuery::MultipleWrite method?
2/20/2014 6:39 PM
The Sophis API provides a method, CSRSqlQuery::MultipleWrite, which enables the developer to insert several records in one command, using arrays. Unfortunately, the method doesn't work fine if an error occurs during an insertion. In this case, next calls to this method will return unpredictable results, like not data found:
This error occurs in fact only when the optional parameter that corresponds to the Oracle cursor is not filled. In this case, the global one which is used remains in uncertain state after the error. This error occurs at least on 5.3.4, 5.3.7 versions of Sophis Risque.
The workaround is in fact quite easy: we just need to not use the global cursor but a local one. The following code permits to resolve such a problem: