Home page  
Help > SDK Help > Client Interface Components >
WhamTech Native API (WhamNAPI)
Version 7.11

 

WhamNAPI Overview.. 1

Purpose. 1

Session and Statement Handles. 1

Sequence of API Calls: Two Examples. 1

WhamNAPI Calls. 3

Appendix A: SQL Syntax. 3

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

Appendix H: Data Types. 3

 

WhamNAPI Overview

Purpose

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.

 

Session and Statement Handles

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.

 

Sequence of API Calls: Two Examples

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

 

 

WhamNAPI Calls

 

SETOPTION Command

 

Functions

tbdrv_alloc_connect()                         // allocate a session handle

tbdrv_alloc_stmt()                              

tbdrv_connect()                                  // connect to a database resource

tbdrv_disconnect()                              // disconnect from database resource

tbdrv_execute_immed_stmt()

tbdrv_execute_stmt()                        

tbdrv_exit()                                          // shutdown driver

tbdrv_fetch_row()

tbdrv_free_connect()                          // free session handle

tbdrv_free_stmt()                               

tbdrv_get_blob_length()

tbdrv_get_colspec()

tbdrv_get_colspec_ex()         

tbdrv_get_colval() 

tbdrv_get_error()

tbdrv_get_tql_commands_count() 

tbdrv_get_tql_command() 

tbdrv_get_lob_col_length() 

tbdrv_get_numcols()              

tbdrv_get_numparams()

tbdrv_get_row_buffer_len()

tbdrv_get_rows()

tbdrv_init()                                           // initialize the driver

tbdrv_init_param()

tbdrv_prepare_stmt()                         

tbdrv_read_blob()

tbdrv_read_lob_col() 

tbdrv_read_loc_col_by_locator()

tbdrv_stmt_returns_rows()

tbdrv_write_blob()

 

Appendix A: SQL Syntax

Appendix B: Database Schema Information

Appendix C: IMPORT Commands

Appendix D: Connected Users Command

Appendix E: Database Limits

Appendix F: Retrieving Results, Accessing BLOB and CLOB Data

Appendix G: Stored Procedures and SQL triggers

Appendix H: Data Types

 

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.