Product Documentation

FairCom Direct SQL for C and C++

Previous Topic

Next Topic

ctsqlSetAutoCommit

Set or clear the auto commit flag.

Note: Be careful using the automatic commit logic when working with cursors. When automatic commit is enabled, the logic will execute a commit operation after each database access, which will close any open cursor. If you receive an error ‑20039 (Open for non-select statement) then most likely your cursor has been closed.

Declaration

CTSQLRET ctsqlSetAutoCommit(pCTSQLCONN hConn, BIT flag)

Description

ctsqlSetAutoCommit() sets or clears the auto commit flag.

  • hConn the connection handle.
  • flag indicates if the auto commit flag is to be turned on or off. CTSQL_TRUE indicates that the auto commit flag is to be turned on, while CTSQL_FALSE indicate that the auto commit flag is to be turned off.

Return

ctsqlSetAutoCommit() returns CTSQLRET_OK on success.

Symbolic Constant

Explanation

SQL_ERR_BADPARAM

Bad parameter specification for the statement.

See Also

ctsqlGetAutoCommit(), ctsqlClearAutoCommit()

TOCIndex