Hitachi

Hitachi Advanced Database Application Development Guide


16.11.4 SQLEndTran

Organization of this subsection

(1) Function

This ODBC function requests commit or rollback processing for all active operations on all statements associated with a connection.

(2) Format

SQLRETURN SQLEndTran
(
  SQLSMALLINT    HandleType,         /* In */
  SQLHANDLE      Handle,             /* In */
  SQLSMALLINT    CompletionType      /* In */
)

(3) Arguments

HandleType

Specifies the following handle type:

  • SQL_HANDLE_DBC: Connection handle

Handle

Specifies a connection handle.

Specify a value that was output by *OutputHandlePtr of SQLAllocHandle before this function is executed.

CompletionType

Specifies one of the following processing:

  • SQL_COMMIT

    Commit processing

  • SQL_ROLLBACK

    Rollback processing

(4) Return value

This ODBC function returns SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or SQL_INVALID_HANDLE.

(5) SQLSTATE

This ODBC function returns one of the following SQLSTATE values:

SQLSTATE

Description

Remarks

Returned

01000

General warning

--

N

08003

Connection does not exist

Y

08007

Connection failure during transaction

N

25S01

Transaction status unknown

N

25S02

Transaction is still active

N

25S03

Transaction is rolled back

N

40001

Serialization failure

N

40002

Integrity mismatch

N

HY000

General error

N

HY001

Memory allocation error

N

HY008

Operation cancelled

N

HY010

Function sequence error

Y

HY012

Invalid transaction processing code

N

HY013

Memory management error

N

HY092

Invalid attribute or option identifier

HandleType or CompletionType was set to an invalid value.

Y

HY115

Environment that contains a connection under asynchronous execution was specified

--

N

HYC00

Optional feature not implemented

N

HYT01

Connection timeout expired

N

IM001

Driver does not support this function

N

IM017

Invalid asynchronous polling

N

IM018

Incomplete asynchronous execution

N

Legend:

Y: This SQLSTATE might be returned by the HADB ODBC driver.

N: This SQLSTATE is not returned by the HADB ODBC driver.

--: None

(6) Notes

This ODBC function does not support the following handle type:

If either of the following handle types is specified, the driver might return SQL_INVALID_HANDLE: