ODBC Function
|
Statement
|
Comments |
SQLAllocEnv
|
none
|
Driver Manager and driver memory allocation. |
SQLAllocConnect
|
none
|
Driver Manager and driver memory allocation. |
SQLConnect
|
CONNECT
|
Association management. |
SQLAllocStmt
|
none
|
Driver Manager and driver memory allocation. |
SQLPrepare
|
PREPARE
|
The prepared SQL string can contain any of the valid preparable functions as defined by the X/Open specification, including ALTER, CREATE, cursor-specification, searched DELETE, dynamic SQL positioned DELETE, DROP, GRANT, INSERT, REVOKE, searched UPDATE, or dynamic SQL positioned UPDATE. |
SQLBindParameter
|
SET DESCRIPTOR
|
Dynamic SQL ALLOCATE DESCRIPTOR and dynamic SQL SET DESCRIPTOR. ALLOCATE DESCRIPTOR would normally be issued on the first call to SQLBindParameter for an hstmt. Alternatively, ALLOCATE DESCRIPTOR can be called during SQLAllocStmt, although this call would be unneeded by SQL statements containing no embedded parameters. The descriptor name is generated by the driver. |
SQLSetCursorName
|
none
|
The specified cursor name is used in the DECLARE CURSOR statement generated by SQLExecute or SQLExecDirect. |
SQLGetCursorName
|
none
|
Driver cursor name management. |
SQLExecute
|
EXECUTE or DECLARE CURSOR and OPEN CURSOR
|
Dynamic SQL EXECUTE. If the SQL statement requires a cursor, then a dynamic SQL DECLARE CURSOR statement and a dynamic SQL OPEN are issued at this time. |
SQLExecDirect
|
EXECUTE IMMEDIATE or DECLARE CURSOR and OPEN CURSOR
|
The ODBC function call provides for support for a cursor specification and statements allowed in an EXECUTE IMMEDIATE dynamic SQL statement. In the case of a cursor specification, the call corresponds to static SQL DECLARE CURSOR and OPEN statements. |
SQLNumResultCols
|
GET DESCRIPTOR
|
COUNT form of dynamic SQL GET DESCRIPTOR. |
SQLColAttributes
|
GET DESCRIPTOR
|
COUNT form of dynamic SQL GET DESCRIPTOR or VALUE form of dynamic SQL GET DESCRIPTOR with field-name in {NAME, TYPE, LENGTH, PRECISION, SCALE, NULLABLE}. |
SQLDescribeCol
|
GET DESCRIPTOR
|
VALUE form of dynamic SQL GET DESCRIPTOR with field-name in {NAME, TYPE, LENGTH, PRECISION, SCALE, NULLABLE}. |
SQLBindCol
|
none
|
This function establishes output buffers that correspond in usage to host variables for static SQL FETCH, and to an SQL DESCRIPTOR for dynamic SQL FETCH cursor USING SQL DESCRIPTOR descriptor. |
SQLFetch
|
FETCH
|
Static or dynamic SQL FETCH. If the call is a dynamic SQL FETCH, then the VALUE form of GET DESCRIPTOR is used, with field-name in {DATA, INDICATOR}. DATA and INDICATOR values are placed in output buffers specified in SQLBindCol. |
SQLRowCount
|
GET DIAGNOSTICS
|
Requested field ROW_COUNT. |
SQLFreeStmt (SQL_CLOSE option)
|
CLOSE
|
Dynamic SQL CLOSE. |
SQLFreeStmt (SQL_DROP option)
|
none
|
Driver Manager and driver memory deallocation. |
SQLTransact
|
COMMIT WORK or COMMIT ROLLBACK
|
None. |
SQLDisconnect
|
DISCONNECT
|
Association management. |
SQLFreeConnect
|
none
|
Driver Manager and driver memory deallocation. |
SQLFreeEnv
|
none
|
Driver Manager and driver memory deallocation. |
SQLCancel
|
none
|
None. |
SQLError
|
GET DIAGNOSTICS
|
GET DIAGNOSTICS retrieves information from the SQL diagnostics area that pertains to the most recently executed SQL statement. This information can be retrieved following execution and preceding the deallocation of the statement. |
Section
|
SQL Statement
|
ODBC Function
|
Comments |
5.2.1
|
CLOSE
|
SQLFreeStmt (SQL_CLOSE option)
|
None. |
5.2.2
|
Positioned DELETE
|
SQLExecDirect(...,
"DELETE FROM table-name WHERE CURRENT OF cursor-name")
|
Driver-generated cursor-name can be obtained by calling SQLGetCursorName. |
5.2.3
|
Searched DELETE
|
SQLExecDirect(..., "DELETE FROM table-name WHERE search-condition")
|
None. |
5.2.4
|
FETCH
|
SQLFetch
|
None. |
5.2.5
|
INSERT
|
SQLExecDirect (...,"INSERT INTO table-name ...")
|
Can also be invoked by SQLPrepare and SQLExecute. |
5.2.6
|
OPEN
|
none
|
Cursor is OPENed implicitly by SQLExecute or SQLExecDirect when a SELECT statement is specified. |
5.2.7
|
SELECT ...INTO
|
none
|
Not supported. |
5.2.8
|
Positioned UPDATE
|
SQLExecDirect(...,
"UPDATE table-name SET column-identifier = expression ...WHERE CURRENT OF cursor-name")
|
Driver-generated cursor-name can be obtained by calling SQLGetCursorName. |
5.2.9
|
Searched UPDATE
|
SQLExecDirect(..., "UPDATE table-name SET column-identifier = expression ...WHERE search-condition")
|
None. |
Section
|
SQL Statement
|
ODBC Function
|
Comments |
5.3
(see 5.2.1)
|
Dynamic SQL CLOSE
|
SQLFreeStmt (SQL_CLOSE option)
|
None. |
5.3(see5.2.2)
|
Dynamic SQL Positioned DELETE
|
SQLExecDirect(...,
"DELETE FROM table-name WHERE CURRENT OF cursor-name")
|
Can also be invoked by SQLPrepare and SQLExecute. |
5.3(see5.2.8)
|
Dynamic SQL Positioned UPDATE
|
SQLExecDirect(...,
"UPDATE table-name SET column-identifier = expression ...WHERE CURRENT OF cursor-name")
|
Can also be invoked by SQLPrepare and SQLExecute. |
5.3.3
|
ALLOCATE DESCRIPTOR
|
None
|
Descriptor information is implicitly allocated and attached to the hstmt by the driver. Allocation occurs at either the first call to SQLBindParameter or at SQLExecute or SQLExecDirect time. |
5.3.4
|
DEALLOCATE DESCRIPTOR
|
SQLFreeStmt (SQL_DROP option)
|
None. |
5.3.5
|
DESCRIBE
|
none
|
None. |
5.3.6
|
EXECUTE
|
SQLExecute
|
None. |
5.3.7
|
EXECUTE IMMEDIATE
|
SQLExecDirect
|
None. |
5.3.8
|
Dynamic SQL FETCH
|
SQLFetch
|
None. |
5.3.9
|
GET DESCRIPTOR
|
SQLNumResultCols
SQLDescribeCol
SQLColAttributes
|
COUNT FORM.
VALUE form with field-name in {NAME, TYPE, LENGTH, PRECISION, SCALE, NULLABLE}. |
5.3.10
|
Dynamic SQL OPEN
|
SQLExecute
|
None. |
5.3.11
|
PREPARE
|
SQLPrepare
|
None. |
5.3.12
|
SET DESCRIPTOR
|
SQLBindParameter
|
SQLBindParameter is associated with only one hstmt where a descriptor is applied to any number of statements with USING SQL DESCRIPTOR. |