Hitachi

Hitachi Advanced Database Application Development Guide


19.1.1 List of CLI functions

HADB provides the CLI functions listed in the table below.

Table 19‒1: List of CLI functions

No.

Classification

CLI function

Function

1

CLI functions for connecting to and disconnecting from the HADB server

a_rdb_SQLAllocConnect()

Allocates a connection handle.

2

a_rdb_SQLConnect()

Establishes a connection with the HADB server.

3

a_rdb_SQLSetConnectAttr()

Sets connection attributes.

4

a_rdb_SQLDisconnect()

Closes a connection.

5

a_rdb_SQLFreeConnect()

Releases a connection handle.

6

CLI functions for controlling transactions

a_rdb_SQLCancel()

Cancels the current SQL processing.

7

a_rdb_SQLEndTran()

Terminates the transaction.

8

CLI functions for execution of SQL statements

Allocating and releasing a statement handle

a_rdb_SQLAllocStmt()

Allocates a statement handle.

9

a_rdb_SQLFreeStmt()

Releases a statement handle.

10

Preprocessing and executing an SQL statement, manipulating a cursor, and fetching rows

a_rdb_SQLPrepare()

Preprocesses an SQL statement.

11

a_rdb_SQLExecute()

Executes a preprocessed SQL statement.

12

a_rdb_SQLExecDirect()

Preprocesses and executes an SQL statement.

13

a_rdb_SQLFetch()

Advances to the next row the cursor that points to the next row to be fetched, and then reads the column values in that row into the fetch target specified in the fetch target list.

14

a_rdb_SQLCloseCursor()

Closes the cursor.

15

Retrieval result columns

a_rdb_SQLNumResultCols()

Acquires the number of retrieval result columns.

16

a_rdb_SQLDescribeCols()

Acquires information about the retrieval result columns.

17

a_rdb_SQLBindCols()

Binds (associates) the retrieval result columns with an area for storing the values fetched from those columns.

18

Dynamic parameters

a_rdb_SQLNumParams()

Acquires the number of dynamic parameters in an SQL statement.

19

a_rdb_SQLDescribeParams()

Acquires an SQL statement's dynamic parameter information.

20

a_rdb_SQLBindParams()

Binds (associates) the dynamic parameters in an SQL statement with an area for specifying their values.

21

a_rdb_SQLBindArrayParams()

Binds (associates) the dynamic parameters in an SQL statement with an area for specifying their values. This CLI function binds the values of multiple sets of dynamic parameters in an SQL statement in batch mode.

22

CLI functions for data type conversion

Converting character string data in C or C++ to SQL data types

a_rdb_CNV_charBINARY()

Converts character string data in C or C++ (binary or hexadecimal) to SQL BINARY type data.

23

a_rdb_CNV_charDATE()

Converts character string data in C or C++ to SQL DATE type data.

24

a_rdb_CNV_charDECIMAL()

Converts character string data in C or C++ to SQL DECIMAL type data.

25

a_rdb_CNV_charTIME()

Converts character string data in C or C++ to SQL TIME type data.

26

a_rdb_CNV_charTIMESTAMP()

Converts character string data in C or C++ to SQL TIMESTAMP type data.

27

a_rdb_CNV_charVARBINARY()

Converts character string data in C or C++ (binary or hexadecimal) to SQL VARBINARY type data.

28

Converting SQL data types to character string data in C or C++

a_rdb_CNV_BINARYchar()

Converts SQL BINARY-type data to character string data in C or C++.

29

a_rdb_CNV_DATEchar()

Converts SQL DATE-type data to character string data in C or C++.

30

a_rdb_CNV_DECIMALchar()

Converts SQL DECIMAL-type data to character string data in C or C++.

31

a_rdb_CNV_TIMEchar()

Converts SQL TIME-type data to character string data in C or C++.

32

a_rdb_CNV_TIMESTAMPchar()

Converts SQL TIMESTAMP-type data to character string data in C or C++.

33

a_rdb_CNV_VARBINARYchar()

Converts SQL VARBINARY-type data to character string data in C or C++.

To use these CLI functions, you must load the header files and the client library provided by the HADB client into a source program coded in C or C++. The following table lists the header files and the client library provided by the HADB client.

Table 19‒2: Header files and client library provided by the HADB client

No.

CLI function to be used

Header file and client library to be used

Header file

Client library

1

CLI functions for connecting to and disconnecting from the HADB server

  • $ADBDIR/include/adbcli.h

  • $ADBDIR/include/adbtypes.h

  • 64-bit edition of Windows

    %ADBCLTDIR%\client\lib\adbclt.lib

  • 32-bit edition of Windows

    %ADBCLTDIR%\client\lib\adbclt32.lib

  • Linux

    $ADBDIR/client/lib/libadbclt.so

2

CLI functions for controlling transactions

3

CLI functions for execution of SQL statements

4

CLI functions for data type conversion

$ADBDIR/include/adbcnv.h

Note: The header file that is required depends on the CLI function being used.