Session and Statement Handles. 1
Sequence of API Calls: Two Examples. 1
Appendix B: Database Schema Information. 3
Appendix C: IMPORT Commands. 3
Appendix D: Connected Users Command. 3
Appendix E: Database Limits. 3
Appendix F: Retrieving Results, Accessing BLOB and CLOB Data. 3
Appendix G: Stored Procedures and SQL triggers. 3
The WhamTech Native API (WhamNAPI) is designed for high performance C/C++ applications that require a low level of control. The driver supports native TQL commands as well as SQL commands. For higher level languages such as Visual Basic, consider using ADO objects. These are readily available and well documented. See http://www.microsoft.com/data for more information on ADO, OLE-DB, and other Microsoft specific tools for data access.
Before you can execute SQL or TQL commands, you must open a session. A session specifies a server (if running in client/server mode) and returns a session handle. This session handle is used in subsequent calls to all other APIs. The driver supports an unlimited number of session handles, and you may mix client/server and local mode sessions within an application.
Statement handles represent a TQL or SQL statement. You can have more than one statement handle open per session handle. Statements have two different forms: immediate statements and result set statements. Immediate statements are commands that do not typically return a result set, for instance, a SQL UPDATE command. Result set statements are commands like SQL SELECT commands that typically return a grid of data.
The following are examples of how API calls are typically sequenced in an application program.
For immediate commands (no result set data to process):
tbdrv_init() // initialize the driver
tbdrv_alloc_connect() // allocate a session handle
tbdrv_connect() // connect to a database resource
tbdrv_alloc_stmt() // allocate a statement handle
tbdrv_execute_immed_stmt() // execute a statement
tbdrv_free_stmt() // free the statement handle
tbdrv_disconnect() // disconnect from database resource
tbdrv_free_connect() // free session handle
tbdrv_exit() // shutdown driver
For commands that generate result sets:
There are two ways to retrieve results:
1. Row-by-row and column-by-column
tbdrv_init() // initialize the driver
tbdrv_alloc_connect() // allocate a session handle
tbdrv_connect() // connect to a database resource
tbdrv_alloc_stmt() // allocate a statement handle
tbdrv_prepare_stmt() // prepare the statement
tbdrv_execute_stmt() // execute the statement
tbdrv_get_numcols() // get column count from result set
tbdrv_get_colspec_ex() // get column info
tbdrv_fetch_row() // iterate through the result set
tbdrv_get_colval() // loop through and get column data
tbdrv_free_stmt() // free the statement handle
tbdrv_disconnect() // disconnect from database resource
tbdrv_free_connect() // free session handle
tbdrv_exit() // shutdown driver
2. Bulk fetch by specified request row count
tbdrv_init() // initialize the driver
tbdrv_alloc_connect() // allocate a session handle
tbdrv_connect() // connect to a database resource
tbdrv_alloc_stmt() // allocate a statement handle
tbdrv_prepare_stmt() // prepare the statement
tbdrv_execute_stmt() // execute the statement
tbdrv_get_numcols() // get column count from result set
tbdrv_get_colspec_ex() // get column info
tbdrv_get_row_buffer_len() // get the size of single row in byte
tbdrv_get_rows() // loop through the result set using bulk fetch
tbdrv_free_stmt() // free the statement handle
tbdrv_disconnect() // disconnect from database resource
tbdrv_free_connect() // free session handle
tbdrv_exit() // shutdown driver
SETOPTION Command
Functions
tbdrv_alloc_connect() // allocate a session handle
tbdrv_connect() // connect to a database resource
tbdrv_disconnect() // disconnect from database resource
tbdrv_exit() // shutdown driver
tbdrv_free_connect() // free session handle
tbdrv_get_tql_commands_count()
tbdrv_init() // initialize the driver
tbdrv_read_loc_col_by_locator()
Copyright © 2019 , WhamTech, Inc. All rights reserved. This
document is provided for information purposes only and the contents hereof are
subject to change without notice. Names may be
trademarks of their respective owners.