Enums and Typedefs
SQLAPI++ Library has the following enumerated
types :
SQLAPI++ Library represents the following typedef
declarations:
SAClient_t
enum describes a list of supported DBMS clients:
typedef enum {
SA_Client_NotSpecified, // Client is not specified
SA_ODBC_Client,
// ODBC client
SA_Oracle_Client,
// Oracle client
SA_SQLServer_Client, // SQL
Server client
SA_InterBase_Client, // InterBase
client
SA_SQLBase_Client, // SQLBase
client
SA_DB2_Client,
// DB2 client
SA_Informix_Client,
// Informix client
SA_Sybase_Client,
// Sybase client
SA_MySQL_Client,
// MySQL client
SA_PostgreSQL_Client
// PostgreSQL client
SA_SQLite_Client
// SQLite client
} SAClient_t;
SAErrorClass_t
enum describes a set of possible types of errors:
typedef enum {
SA_No_Error,
//
No error occurred
SA_UserGenerated_Error, // User-generated
error
SA_Library_Error,
// The Library error
SA_DBMS_API_Error // DBMS
API error
} SAErrorClass_t;
SAIsolationLevel_t
enum describes a possible transaction isolation levels:
typedef enum {
SA_LevelUnknown
=
-1,
//
the default
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_ReadUncommitted = SA_ANSILevel0, // isolation
level 'Read Uncommitted'
SA_ReadCommitted = SA_ANSILevel1, // isolation
level 'Read Committed'
SA_RepeatableRead = SA_ANSILevel2, // isolation
level 'Repeatable Read'
SA_Serializable
=
SA_ANSILevel3
// isolation level 'Serializable'
} SAIsolationLevel_t;
SAAutoCommit_t
enum describes autocommit modes:
typedef enum {
SA_AutoCommitUnknown = -1, // Autocommit mode is
unknown
SA_AutoCommitOff,
//
Autocommit is off
SA_AutoCommitOn
//
Autocommit is on
} SAAutoCommit_t;
SADataType_t
enum describes a list of supported datatypes:
typedef enum {
SA_dtUnknown,
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_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 string (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)
SA_dtSpecificToDBMS
// data type is server-specific and not interpreted by SQLAPI++
} SADataType_t;
SACommandType_t
enum describes types of a command:
typedef enum {
SA_CmdUnknown, // Command type
is not defined
SA_CmdSQLStmt, // Command
is an SQL statement
SA_CmdSQLStmtRaw, // Command
is an SQL statement and not
interpreted by SQLAPI++
SA_CmdStoredProc // Command is a stored
procedure or a function
} SACommandType_t;
SAParamDirType_t
enum describes types of a parameter:
typedef enum {
SA_ParamInput,
// Input parameter
SA_ParamInputOutput, // Input/output
parameter
SA_ParamOutput,
// Output parameter
SA_ParamReturn
// Returning parameter
} SAParamDirType_t;
SALongOrLobReaderModes_t
enum describes Long or Lob(CLob) data reading modes:
typedef enum {
SA_LongOrLobReaderDefault, // Long or
Lob(CLob) data reading mode is default
SA_LongOrLobReaderManual // Long or
Lob(CLob) data reading mode is manual
} SALongOrLobReaderModes_t;
SAPieceType_t
enum describes read piece of Long or Lob(CLob) data
description:
typedef enum {
SA_FirstPiece =
1, // The first (but not the last)
piece of data
SA_NextPiece =
2, // The next (not the first and not the
last) piece of data
SA_LastPiece =
3, // The last piece of data
SA_OnePiece =
4 // All required data is represented
as one block
} SAPieceType_t;
saLongOrLobWriter_t
typedef declaration defines Long or Lob writer callback:
typedef size_t
(*saLongOrLobWriter_t) (
SAPieceType_t
&ePieceType,
void
*pBuf,
size_t
nLen,
void *pAddlData
);
User defined function has the following parameters:
ePieceType. Defines which
piece of data value was written. Can be one of the SAPieceType_t enum values.
pBuf. Pointer to the buffer
that contains the data block written to database.
nLen. The actual size of data
in buffer pBuf.
pAddData. An additional data
user want to pass to the function.
saLongOrLobReader_t
typedef declaration defines Long or Lob reader callback:
typedef void
(*saLongOrLobReader_t) (
SAPieceType_t
ePieceType,
void
*pBuf,
size_t nLen,
size_t
nBlobSize,
void *pAddlData
);
User defined function has the following parameters:
ePieceType. Parameter passed
to the function from SQLAPI++ Library mechanisms. It defines
which piece of data value was read. Can be one of the SAPieceType_t enum values.
pBuf. Pointer to the buffer
that contains the data block read from database.
nLen. The actual size of data
in buffer pBuf.
nBlobSize. A size of whole
Long or BLob(CLob) field (if DBMS server allows to know it before whole
field was read; otherwise 0).
pAddData. An additional data
user want to pass to the function.
|