detect if error caused transaction to rollback using ODBC
Is there a way in ODBC to find out if an error caused the current transaction to rollback automatically, as opposed to only aborting the current statement and leaving the transaction open? The behavior varies from driver to driver, and the postgresql odbc driver even makes configurable as a connection option (maybe others do too, I don't know).
Some context: I'm creating an ODBC binding for a scripting language, so I can't rely on any knowledge of the statements being executed, the drivers, or the data source configurations. I have a safe alternativ开发者_StackOverflowe in mind if I can't get this information---always rollback on every error---but it would be much nicer to provide the option to continue when possible.
精彩评论