Skip to content

Altibase CLI API

Altibase CLI API#

API Categorization#

The API of the Altibase CLI consists of functions that define environment for running applications, managing connections, and processing SQL statements and transactions. Depending on the features of each function, these are grouped by followings:

  • Managing Environments and Connections
  • SQL Processing
  • Setting and Retrieving Driver Attributes
  • Meta data processing

Managing Environments and Connections#

The APIs that allocate resources necessary for the connection to the database server and provide connection-related features. Releases the memory space after disconnected from datasources.

SQL Processing#

The APIs that allocate resources and prepare commands for the processing, executing and retreiving results of SQL statements.

Setting and Retrieving Driver Attributes#

The APIs that set the environment for the processing of the SQL, connection status, and statement attributes.

Metadata Processing#

The APIs that provide features to define tables and columns and to retrieve database metadata.

API List#

Altibase CLI functions are listed in the following table. For further information on each function, please refer to Chapter 2: Altibase CLI Functions.

Task Function Name Purpose
Managing environments and connections
SQLAllocConnect Obtains an environment, connection, statement, or descriptor handle
SQLAllocEnv Allocates an environment, connection, statement, or descriptor handle
SQLAllocStmt Obtains statement handles and Allocates memory
SQLAllocHandle Initializes of resources, environments, and statement handles and allocates memory
SQLCloseCursor This closes cursor and discards pending results
SQLConnect Connects to a target database
SQLDisconnect Closes the connection. Releases an environment, connection, statement, or descriptor handle
SQLDriverConnect Connects to a specific driver by connection string or requests that the Driver Manager and driver display connection dialog boxes for the user
SQLEndTran Commits or rolls back a transaction
SQLFreeConnect Closes the connection handle, and releases the memory
SQLFreeEnv Closes the environment handle, and releases the memory
SQLFreeHandle Releases the memory allocated to the connection, the handle, and the command
SQLFreeStmt Closes the statement handle, and releases the allocated memory
SQLTransact Commits or releases all changes related to the database
SQL Processing Requesting SQLBindParameter Binds the parameter to a SQL statement
SQLExecDirect Directly executes a SQL statement
SQLExecute Executes a prepared SQL statement
SQLNativeSql Efficiently tests the syntax of SQL statements and converts it to that Altibase supports
SQLParamData Supplies data at statement execution time.
SQLPrepare Prepares a SQL statement for later execution
SQLPutData This is used to supply data at statement execution time
Retrieving SQLBindCol Defines the buffer and the data type to receive the columns of the result set
SQLColAttribute Defines the attributes about the columns of the result set
SQLDescribeCol Checks the metadata about one column in the result set
SQLDescribeParam Checks information related to the parameter marker (?) in the result set
SQLError Checks diagnosis messages related to the recently called Altibase CLI function
SQLFetch Returns multiple result rows
SQLFetchScroll The result set the cursor to the desired direction of progress, and get a column to bind
SQLGetConnectAttr Returns the properties setting of connection
SQLGetData Returns the data of a specified column in the result set
SQLGetInfo Retrieve DBMS information connected to the application
SQLGetStmtAttr Returns the attributes related to the current statement handle
SQLGetTypeInfo Returns the information about the data type supported by the database
SQLNumParams SReturns the number of parameters in a SQL statement
SQLNumResultCols Returns the number of columns in the result set
SQLRowCount Returns the number of rows affected by an insert, update, or delete request
SQLMoreResults If multiple results are generated execution, it changes the result of interest to the next result.
Setting and retrieving driver attributes SQLGetEnvAttr Returns the current setting of an environment attribute
SQLGetFunctions Returns information about whether a driver supports a specific Altibase CLI function.
SQLSetConnectAttr Sets the connection attributes
SQLSetEnvAttr Sets the environment attributes
SQLSetStmtAttr Sets the statement attributes
Metadata Processing (catalog functions) SQLColumns Returns the list of column names in specified tables
SQLForeignKeys Returns a list of column names that make up foreign keys, if they exist for a specified table
SQLGetDescField Returns a single field of a descriptor record
SQLGetDescRec Returns values of multiple fields of a descriptor record
SQLGetDiagField Diagnoses the result after the function is used
SQLGetDiagRec Returns several commonly used fields of a diagnostic record after using the function
SQLPrimaryKeys Returns the list of column names that make up the primary key for a table
SQLProcedureColumns Returns the list of input and output parameters, as well as the columns that make up the result set for the specified procedures
SQLProcedures Returns the list of procedure names stored in a specific database
SQLSetDescField Sets the descriptor field
SQLSpecialColumns Searches for specific columns
SQLStatistics Returns statistics about a single table and the list of indexes associated with the table
SQLTablePrivileges Returns a list of tables and the privileges associated with each table
SQLTables Returns the list of table names stored in a specific database