SQLAPI.h File Reference

General SQLAPI++ include file. More...

#include <wchar.h>
#include <wctype.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include <time.h>
#include <stdarg.h>
#include <limits.h>

Data Structures

class  IsaAPI
 Base class for all DBMS API wrappers. More...
 
class  saConnectionHandles
 Base class for DBMS specific connection handle(s). More...
 
class  saCommandHandles
 Base class for DBMS specific command handle(s). More...
 
class  SAString
 Provides support for manipulating character values. More...
 
class  SANull
 Defines a specific empty/NULL data class for SACommand << operator. More...
 
class  SANumeric
 Provides support for manipulating NUMERIC values. More...
 
class  SAInterval
 This is MySQL specific class that is used to represent MySQL TIME data type. More...
 
class  SADateTime
 Provides support for manipulating date/time values. More...
 
class  SAPos
 A subsidiary class to specify a parameter position for SACommand << operator. More...
 
class  SAOptions
 A subsidiary class to specify an object with options. More...
 
class  SAPI
 Represents a database API. The point you have to start with. More...
 
class  SAConnection
 The DBMS connection class. Represents an unique session with a data source. More...
 
class  SACommand
 Defines a specific command that you intend to execute against a data source. More...
 
class  SAValueRead
 Base DBMS values storage class. More...
 
class  SAValue
 Subsidiary class. More...
 
class  SAParam
 Defines a specific command parameter that you assign and/or read the value. More...
 
class  SABytes
 A subsidiary class to bind a SA_dtBytes parameter with SACommand << operator. More...
 
class  SALongOrLob
 A subsidiary class to bind a long or LOB parameter with SACommand << operator. More...
 
class  SALongBinary
 A subsidiary class to bind a SA_dtLongBinary parameter with SACommand << operator. More...
 
class  SALongChar
 A subsidiary class to bind a SA_dtLongChar parameter with SACommand << operator. More...
 
class  SABLob
 A subsidiary class to bind a SA_dtBLob parameter with SACommand << operator. More...
 
class  SACLob
 A subsidiary class to bind a SA_dtCLob parameter with SACommand << operator. More...
 
class  SAField
 Defines a specific command result set field that you read the value. More...
 
class  SAException
 Library error exception class. More...
 
class  SAGlobals
 Global SQLAPI++ settings class. More...
 

Macros

#define _TSA(x)   x
 SQLAPI++ macros for character constants.
 
#define SACMD_PREFETCH_ROWS   _TSA("PreFetchRows")
 Prefetching rows SACommand option.
 
#define SACMD_SCROLLABLE   _TSA("Scrollable")
 Using scrollable cursor SACommand option.
 
#define SAOPT_TRUE   _TSA("1")
 Option value.
 

Typedefs

typedef bool(SQLAPI_CALLBACK * PreHandleException_t) (SAException &x, void *pAddlData)
 Callback for exception pre-handling.
 
typedef size_t(SQLAPI_CALLBACK * saLongOrLobWriter_t) (SAPieceType_t &ePieceType, void *pBuf, size_t nLen, void *pAddlData)
 Long or LOB writer callback, use for parameter binding.
 
typedef void(SQLAPI_CALLBACK * saLongOrLobReader_t) (SAPieceType_t ePieceType, void *pBuf, size_t nLen, size_t nBlobSize, void *pAddlData)
 Long or LOB data reader callback. More...
 
typedef void(SQLAPI_CALLBACK * saConnectionHandler_t) (SAConnection &con, SAConnectionHandlerType_t eHandlerType)
 DBMS connection handling callback.
 
typedef char SAChar
 Default type for character symbol.
 
typedef void(SQLAPI_CALLBACK * SATraceFunction_t) (SATraceInfo_t traceInfo, SAConnection *pCon, SACommand *pCmd, const SAChar *szTraceInfo, void *pData)
 Callback function for tracing. More...
 

Enumerations

enum  SAClient_t {
  SA_Client_NotSpecified, SA_ODBC_Client, SA_Oracle_Client, SA_SQLServer_Client,
  SA_InterBase_Client, SA_SQLBase_Client, SA_DB2_Client, SA_Informix_Client,
  SA_Sybase_Client, SA_MySQL_Client, SA_PostgreSQL_Client, SA_SQLite_Client,
  SA_SQLAnywhere_Client, SA_CubeSQL_Client
}
 DBMS client type. Describes a list of supported DBMS client types. More...
 
enum  SAErrorClass_t { SA_No_Error, SA_UserGenerated_Error, SA_Library_Error, SA_DBMS_API_Error }
 Possible types of errors. Describes a set of possible types of a error. More...
 
enum  SALibraryErrorType_t {
  SA_Library_Error_Nomem, SA_Library_Error_ClientNotSet, SA_Library_Error_ClientNotSupported, SA_Library_Error_LoadLibraryFails,
  SA_Library_Error_GetLibraryVersionFails, SA_Library_Error_ClienVersionOld, SA_Library_Error_ClientInitFails, SA_Library_Error_BindVarNotFound,
  SA_Library_Error_FieldNotFound, SA_Library_Error_UnknownDataType, SA_Library_Error_UnknownParameterType, SA_Library_Error_UnknownColumnType,
  SA_Library_Error_WrongConversion, SA_Library_Error_WrongDatetime
}
 Possible types of the Library errors. Describes a set of possible types of a error generated by SQLAPI++. More...
 
enum  SAIsolationLevel_t {
  SA_LevelUnknown = -1, SA_ANSILevel0, SA_ANSILevel1, SA_ANSILevel2,
  SA_ANSILevel3, SA_Snapshot, SA_ReadUncommitted = SA_ANSILevel0, SA_ReadCommitted = SA_ANSILevel1,
  SA_RepeatableRead = SA_ANSILevel2, SA_Serializable = SA_ANSILevel3
}
 Possible transaction isolation levels. Describes a set of possible transaction isolation levels. More...
 
enum  SAAutoCommit_t { SA_AutoCommitUnknown = -1, SA_AutoCommitOff, SA_AutoCommitOn }
 Possible auto-commit modes. Describes a set of possible auto-commit modes. More...
 
enum  SADataType_t {
  SA_dtUnknown, SA_dtBool, SA_dtShort, SA_dtUShort,
  SA_dtLong, SA_dtULong, SA_dtInt64, SA_dtUInt64,
  SA_dtDouble, SA_dtNumeric, SA_dtDateTime, SA_dtInterval,
  SA_dtString, SA_dtBytes, SA_dtLongBinary, SA_dtLongChar,
  SA_dtBLob, SA_dtCLob, SA_dtCursor, SA_dtSpecificToDBMS
}
 SQLAPI++ program data types. Describes a list of supported datatypes. More...
 
enum  SACommandType_t { SA_CmdUnknown, SA_CmdSQLStmt, SA_CmdSQLStmtRaw, SA_CmdStoredProc }
 SACommand type. More...
 
enum  SAParamDirType_t { SA_ParamInput, SA_ParamInputOutput, SA_ParamOutput, SA_ParamReturn }
 SAParam direction type. Describes types of a command parameter. More...
 
enum  SALongOrLobReaderModes_t { SA_LongOrLobReaderDefault, SA_LongOrLobReaderManual }
 Long or Lob(CLob) data reading mode. Describes Long or Lob(CLob) data reading modes. More...
 
enum  SAPieceType_t { SA_FirstPiece = 1, SA_NextPiece = 2, SA_LastPiece = 3, SA_OnePiece = 4 }
 Read piece of LONG or Lob(CLob) data description. More...
 
enum  SAConnectionHandlerType_t { SA_PreConnectHandler, SA_PostConnectHandler }
 Describes types of a handle called for DBMS connection. More...
 
enum  SATraceInfo_t
 The Library trace information type.
 

Detailed Description

General SQLAPI++ include file.

Typedef Documentation

◆ saLongOrLobReader_t

typedef void(SQLAPI_CALLBACK* saLongOrLobReader_t) (SAPieceType_t ePieceType, void *pBuf, size_t nLen, size_t nBlobSize, void *pAddlData)

Long or LOB data reader callback.

Define own function and use use it for the field or output parameter data fetching.

See also
SAField::ReadLongOrLob SAParam::ReadLongOrLob

◆ SATraceFunction_t

typedef void(SQLAPI_CALLBACK* SATraceFunction_t) (SATraceInfo_t traceInfo, SAConnection *pCon, SACommand *pCmd, const SAChar *szTraceInfo, void *pData)

Callback function for tracing.

See also
SAGlobals::SetTraceFunction

Enumeration Type Documentation

◆ SAClient_t

enum SAClient_t

DBMS client type. Describes a list of supported DBMS client types.

Enumerator
SA_Client_NotSpecified 

DBMS client is not specified.

SA_ODBC_Client 

ODBC client.

SA_Oracle_Client 

Oracle client.

SA_SQLServer_Client 

Microsoft SQL Server client.

SA_InterBase_Client 

InterBase/Firebird client.

SA_SQLBase_Client 

SQLBase client.

SA_DB2_Client 

IBM DB2 client.

SA_Informix_Client 

Informix client.

SA_Sybase_Client 

Sybase ASE client.

SA_MySQL_Client 

MySQL client.

SA_PostgreSQL_Client 

PostgreSQL client.

SA_SQLite_Client 

SQLite client.

SA_SQLAnywhere_Client 

SQL Anywere client.

SA_CubeSQL_Client 

CubeSQL client.

◆ SAErrorClass_t

Possible types of errors. Describes a set of possible types of a error.

Enumerator
SA_No_Error 

no error occurred

no error occurred

SA_UserGenerated_Error 

user-generated error

SA_Library_Error 

the Library-generated error

SA_DBMS_API_Error 

DBMS API error occurred.

◆ SALibraryErrorType_t

Possible types of the Library errors. Describes a set of possible types of a error generated by SQLAPI++.

Enumerator
SA_Library_Error_Nomem 

The memory allocation failed.

SA_Library_Error_ClientNotSet 

The DBMS client type is not set for SQLAPI++ object.

SA_Library_Error_ClientNotSupported 

Requested DBMS client is not supported.

SA_Library_Error_LoadLibraryFails 

Loading of the DBMS client API library failed.

SA_Library_Error_GetLibraryVersionFails 

Reading of the DBMS client API library version failed.

SA_Library_Error_ClienVersionOld 

DBMS client API version is too old.

SA_Library_Error_ClientInitFails 

DBMS client API initialization failed.

SA_Library_Error_BindVarNotFound 

Requested parameter not found (unknown number or name)

SA_Library_Error_FieldNotFound 

Requested field not found (unknown number or name)

SA_Library_Error_UnknownDataType 

Unknown value data type detected.

SA_Library_Error_UnknownParameterType 

Unknown command parameter type detected.

SA_Library_Error_UnknownColumnType 

Unknown result column type detected.

SA_Library_Error_WrongConversion 

Wrong conversion direction requested.

SA_Library_Error_WrongDatetime 

Wrong date/time data or format.

◆ SAIsolationLevel_t

Possible transaction isolation levels. Describes a set of possible transaction isolation levels.

Enumerator
SA_LevelUnknown 

the default(unknown) isolation level

the default(unknown) isolation level

SA_ANSILevel0 

standard ANSI isolation level 0

SA_ANSILevel1 

standard ANSI isolation level 1

SA_ANSILevel2 

standard ANSI isolation level 2

SA_ANSILevel3 

standard ANSI isolation level 3

SA_Snapshot 

isolation level 'Snapshot'

SA_ReadUncommitted 

isolation level 'Read Uncommitted'

SA_ReadCommitted 

isolation level 'Read Committed'

SA_RepeatableRead 

isolation level 'Repeatable Read'

SA_Serializable 

isolation level 'Serializable'

◆ SAAutoCommit_t

Possible auto-commit modes. Describes a set of possible auto-commit modes.

Enumerator
SA_AutoCommitUnknown 

the default(unknown) auto-commit mode

SA_AutoCommitOff 

auto-commit mode is off

SA_AutoCommitOn 

auto-commit mode is on

◆ SADataType_t

SQLAPI++ program data types. Describes a list of supported datatypes.

Enumerator
SA_dtUnknown 

data type is unknown

SA_dtBool 

data type is C bool

SA_dtShort 

data type is C short

SA_dtUShort 

data type is C unsigned short

SA_dtLong 

data type is C long

SA_dtULong 

data type is C unsigned long

SA_dtInt64 

data type is 8-bit integer

SA_dtUInt64 

data type is 8-bit unsigned integer

SA_dtDouble 

data type is C double

SA_dtNumeric 

data type is SANumeric

SA_dtDateTime 

data type is SADateTime

SA_dtInterval 

data type is SAInterval (MySQL specific - for MySQL TIME data type)

SA_dtString 

data type is character string (SAString)

SA_dtBytes 

data type is binary array (SAString)

SA_dtLongBinary 

data type is long binary data (SAString)

SA_dtLongChar 

data type is long character data (SAString)

SA_dtBLob 

data type is BLob data (SAString)

SA_dtCLob 

data type is CLob data (SAString)

SA_dtCursor 

data type is Oracle REF CURSOR (SACommand - for Oracel only)

SA_dtSpecificToDBMS 

data type is server-specific and not interpreted by SQLAPI++

◆ SACommandType_t

SACommand type.

Describes a set of possible types of SACmmand. By default the Library tries to determine the SQL command type itself.It analyzes the query command, sets the command types and build the parameter list.

Remarks
For any supported DBMS SQLAPI++ interprets the ":<name>" or ":<number>" SQL command substrings as a bind parameter positions and builds the parameter list.
Enumerator
SA_CmdUnknown 

command type is not defined

SA_CmdSQLStmt 

command is an SQL statement (with or without parameters)

SA_CmdSQLStmtRaw 

command is a raw SQL statement and not interpreted by SQLAPI++

SA_CmdStoredProc 

command is a stored procedure or a function

◆ SAParamDirType_t

SAParam direction type. Describes types of a command parameter.

Enumerator
SA_ParamInput 

Input parameter.

SA_ParamInputOutput 

Input/output parameter.

SA_ParamOutput 

Output parameter.

SA_ParamReturn 

Returning parameter (function or procedure returning value)

◆ SALongOrLobReaderModes_t

Long or Lob(CLob) data reading mode. Describes Long or Lob(CLob) data reading modes.

Enumerator
SA_LongOrLobReaderDefault 

Long or Lob(CLob) data reading mode is default.

SA_LongOrLobReaderManual 

Long or Lob(CLob) data reading mode is manual.

◆ SAPieceType_t

Read piece of LONG or Lob(CLob) data description.

Describes read piece of LONG or Lob(CLob) data description

Enumerator
SA_FirstPiece 

The first (but not the last) piece of data.

SA_NextPiece 

The next (not the first and not the last) piece of data.

SA_LastPiece 

The last piece of data.

SA_OnePiece 

All required data is represented as one block.

◆ SAConnectionHandlerType_t

Describes types of a handle called for DBMS connection.

The Library allows to define the DBMS connection process handler.

Enumerator
SA_PreConnectHandler 

The handles is called after DBMS connection structures is allocated.

SA_PostConnectHandler 

The handles is called after DBMS connection is esteblished.

If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to howto@sqlapi.com
SQLAPI++ 5.0.1, Mon Oct 21 2019