Why doesn't a query return recently inserted data?

The issue reported to us is: "INSERT statements seem to work OK and an immediate SELECT with the same cursor displays the data, but when I retry the query, the data is gone."

Some ODBC-enabled languages have autocommit set to off by default. There are two ways to ensure that INSERT statements are committed:

  1. Turn on the relevant autocommit flag in your connection.
  2. Use appropriate commit and rollback methods in your script.

Refer to the following resources for detailed information on how to do this: