SQLAPI.h File Reference

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)   L ## x
 SQLAPI++ macros for character constants.
 
#define SACMD_PREFETCH_ROWS   _TSA("PreFetchRows")
 Pre-fetching rows SACommand option.
 
#define SACMD_SCROLLABLE   _TSA("Scrollable")
 Using scrollable cursor SACommand option.
 
#define SAOPT_TRUE   _TSA("1")
 Option value.
 

Typedefs

typedef wchar_t SAChar
 Default type for character symbol.
 
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 bool(SQLAPI_CALLBACK * PreHandleException_t) (SAException &x, void *pAddlData)
 Callback for exception pre-handling.
 
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_ClientVersionOld, 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 data types. 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.
 
enum  SABool_t { SA_ReturnError = -1, SA_False, SA_True }
 Enum describes possible result returned by the Library C function. More...
 

Functions

SAExceptionsqlapi_alloc_error ()
 Allocates the Library error handle. More...
 
void sqlapi_free_error (SAException **perr)
 Releases all error handle related resources. More...
 
SAStringsqlapi_error_text (const SAException *error)
 Gets the SAException error text. More...
 
const SACharsqlapi_error_message (const SAException *error)
 Gets the SAException error message. More...
 
int sqlapi_error_native_code (const SAException *err)
 Gets the SAException error native code. More...
 
int sqlapi_error_pos (const SAException *err)
 Gets the SAException error position. More...
 
SAErrorClass_t sqlapi_error_class (const SAException *err)
 Gets the SAException error class. More...
 
const SAExceptionsqlapi_error_nested (const SAException *err)
 Gets the SAException nested error. More...
 
SABool_t sqlapi_has_error (const SAException *error)
 Checks if SAException handle contains DBMS error information.
 
SAPIsqlapi_alloc_api ()
 Allocates new API handle. More...
 
void sqlapi_free_api (SAPI **papi)
 Releases all API handle related resources. More...
 
void sqlapi_set_api_option (SAPI *api, const SAChar *szOption, const SAChar *szValue)
 Sets SAPI handle option. More...
 
SAErrorClass_t sqlapi_init (SAPI *api, SAClient_t type, SAException *err)
 Initializes SAPI handle with specified DBMS client type. More...
 
SAConnectionsqlapi_alloc_connection (SAPI *api)
 Allocates new connection handle. More...
 
void sqlapi_free_connection (SAConnection **pcon)
 Releases all connection handle related resources. More...
 
void sqlapi_set_connection_option (SAConnection *conn, const SAChar *szOption, const SAChar *szValue)
 Sets SAConnection handle option. More...
 
SAErrorClass_t sqlapi_connect (SAConnection *conn, const SAChar *szConnectionStr, const SAChar *szUser, const SAChar *szPassword, SAException *err)
 Connects SAConnection handle. More...
 
SAErrorClass_t sqlapi_disconnect (SAConnection *conn, SAException *err)
 Disconnects SAConnection handle. More...
 
SABool_t sqlapi_is_connected (SAConnection *conn, SAException *err)
 Checks if SAConnection is connected. More...
 
SABool_t sqlapi_is_alive (SAConnection *conn, SAException *err)
 Checks if SAConnection is alive. More...
 
void sqlapi_reset_connection (SAConnection *conn)
 Resets SAConnection handle. More...
 
SAErrorClass_t sqlapi_commit (SAConnection *conn, SAException *err)
 Commits the database session changes. More...
 
SAErrorClass_t sqlapi_rollback (SAConnection *conn, SAException *err)
 Rollbacks the database session changes. More...
 
SAErrorClass_t sqlapi_set_auto_commit (SAConnection *conn, SAAutoCommit_t mode, SAException *err)
 Changes the database session auto-commit mode. More...
 
SAErrorClass_t sqlapi_set_isolation_level (SAConnection *conn, SAIsolationLevel_t level, SAException *err)
 Changes the database session isolation level. More...
 
SACommandsqlapi_alloc_command (SAConnection *con)
 Allocates new command handle. More...
 
void sqlapi_free_command (SACommand **pcmd)
 Releases all command handle related resources. More...
 
void sqlapi_set_command_option (SACommand *cmd, const SAChar *szOption, const SAChar *szValue)
 Sets SACommand handle option. More...
 
SAErrorClass_t sqlapi_execute (SACommand *cmd, const SAChar *szQuery, SAException *err)
 Executes SQL command. More...
 
void sqlapi_reset_command (SACommand *cmd)
 Resets SACommand handle. More...
 
SABool_t sqlapi_is_result_set (SACommand *cmd, SAException *err)
 Checks if any result set exists. More...
 
SABool_t sqlapi_fetch_next (SACommand *cmd, SAException *err)
 Fetches next row of the result set. More...
 
SABool_t sqlapi_fetch_prior (SACommand *cmd, SAException *err)
 Fetches previous row of the result set. More...
 
SABool_t sqlapi_fetch_first (SACommand *cmd, SAException *err)
 Fetches the first row of the result set. More...
 
SABool_t sqlapi_fetch_last (SACommand *cmd, SAException *err)
 Fetches the last row of the result set. More...
 
SABool_t sqlapi_fetch_pos (SACommand *cmd, int offset, SABool_t relative, SAException *err)
 Fetches the specified row of the result set. More...
 
int sqlapi_param_count (SACommand *cmd, SAException *err)
 Returns the command parameters count. More...
 
SAParamsqlapi_param_by_index (SACommand *cmd, int nIndex, SAException *err)
 Returns SAParam handle. More...
 
SAParamsqlapi_param (SACommand *cmd, int nParamByID, SAException *err)
 Returns parameter handle. More...
 
SAParamsqlapi_param_by_name (SACommand *cmd, const SAChar *szParamByName, SAException *err)
 Returns SAParam handle. More...
 
SADataType_t sqlapi_param_type (const SAParam *par)
 Returns SAParam type. More...
 
int sqlapi_param_native_type (const SAParam *par)
 Returns SAParam native type. More...
 
SAParamDirType_t sqlapi_param_direction (const SAParam *par)
 Returns SAParam direction. More...
 
size_t sqlapi_param_size (const SAParam *par)
 Returns SAParam size. More...
 
int sqlapi_param_precision (const SAParam *par)
 Returns SAParam precision. More...
 
int sqlapi_param_scale (const SAParam *par)
 Returns SAParam scale. More...
 
const SAValueReadsqlapi_param_value (SACommand *cmd, int nParamByID, SAException *err)
 Returns parameter value handle. More...
 
const SAValueReadsqlapi_param_value_by_name (SACommand *cmd, const SAChar *szParamByName, SAException *err)
 Returns parameter value handle. More...
 
void sqlapi_param_set_short (SAParam *par, short val)
 Sets the parameter value as short integer. More...
 
void sqlapi_param_set_ushort (SAParam *par, unsigned short val)
 Sets the parameter value as unsigned short integer. More...
 
void sqlapi_param_set_int32 (SAParam *par, long val)
 Sets the parameter value as long integer. More...
 
void sqlapi_param_set_uint32 (SAParam *par, unsigned long val)
 Sets the parameter value as unsigned long integer. More...
 
void sqlapi_param_set_int64 (SAParam *par, sa_int64_t val)
 Sets the parameter value as 64-bit integer. More...
 
void sqlapi_param_set_uint64 (SAParam *par, sa_uint64_t val)
 Sets the parameter value as unsigned 64-bit integer. More...
 
void sqlapi_param_set_string (SAParam *par, const SAString *val)
 Sets the parameter value as string. More...
 
void sqlapi_param_set_numeric (SAParam *par, const SANumeric *val)
 Sets the parameter value as numeric. More...
 
void sqlapi_param_set_datetime (SAParam *par, const SADateTime *val)
 Sets the parameter value as date/time. More...
 
void sqlapi_param_set_double (SAParam *par, double val)
 Sets the parameter value as double. More...
 
void sqlapi_param_set_bytes (SAParam *par, const SAString *val)
 Sets the parameter value as binary data. More...
 
int sqlapi_field_count (SACommand *cmd, SAException *err)
 Returns the result set field count. More...
 
const SAFieldsqlapi_field (SACommand *cmd, int nField, SAException *err)
 Returns the result set field handle. More...
 
const SAValueReadsqlapi_field_value (SACommand *cmd, int nField, SAException *err)
 Returns the result set field value handle. More...
 
const SAFieldsqlapi_field_by_name (SACommand *cmd, const SAChar *szField, SAException *err)
 Returns the result set field handle. More...
 
const SAValueReadsqlapi_field_value_by_name (SACommand *cmd, const SAChar *szField, SAException *err)
 Returns the result set field value handle. More...
 
const SACharsqlapi_field_name (const SAField *field)
 Returns SAField name. More...
 
SADataType_t sqlapi_field_type (const SAField *field)
 Returns SAField type. More...
 
int sqlapi_field_native_type (const SAField *field)
 Returns SAField native type. More...
 
size_t sqlapi_field_data_size (const SAField *field)
 Returns SAField size. More...
 
int sqlapi_field_precision (const SAField *field)
 Returns SAField precision. More...
 
int sqlapi_field_scale (const SAField *field)
 Returns SAField scale. More...
 
short sqlapi_value_as_short (const SAValueRead *val)
 Returns the short value. More...
 
unsigned short sqlapi_value_as_ushort (const SAValueRead *val)
 Returns the unsigned short value. More...
 
long sqlapi_value_as_int32 (const SAValueRead *val)
 Returns the 32-bit integer value. More...
 
unsigned long sqlapi_value_as_uint32 (const SAValueRead *val)
 Returns the unsigned 32-bit integer value. More...
 
sa_int64_t sqlapi_value_as_int64 (const SAValueRead *val)
 Returns the 64-bit integer value. More...
 
sa_uint64_t sqlapi_value_as_uint64 (const SAValueRead *val)
 Returns the unsigned 64-bit integer value. More...
 
SAStringsqlapi_value_as_string (const SAValueRead *val)
 Returns the string value. More...
 
SANumericsqlapi_value_as_numeric (const SAValueRead *val)
 Returns the numeric value. More...
 
SADateTimesqlapi_value_as_datetime (const SAValueRead *val)
 Returns the date/time value. More...
 
double sqlapi_value_as_double (const SAValueRead *val)
 Returns the double value. More...
 
const SACommandsqlapi_value_as_cursor (const SAValueRead *val)
 Returns the resultset associated with the value. More...
 
SAStringsqlapi_value_as_bytes (const SAValueRead *val)
 Returns the binary data of the value. More...
 
SAStringsqlapi_alloc_string (const SAString *src)
 Allocates new string handle. More...
 
void sqlapi_free_string (SAString **pstr)
 Releases the string handle. More...
 
const char * sqlapi_string_mb (const SAString *str)
 Returns the multi-byte string stored with SAString handle. More...
 
size_t sqlapi_string_mb_length (const SAString *str)
 Returns the multi-byte string length stored with SAString handle. More...
 
void sqlapi_string_set_mb_string (SAString *str, const char *src, size_t len)
 Sets the multi-byte string into SAString handle. More...
 
const wchar_t * sqlapi_string_wide (const SAString *str)
 Returns the wide string stored with SAString handle. More...
 
size_t sqlapi_string_wide_length (const SAString *str)
 Returns the wide string length stored with SAString handle. More...
 
void sqlapi_string_set_wide_string (SAString *str, const wchar_t *src, size_t len)
 Sets the wide string into SAString handle. More...
 
const char * sqlapi_string_utf8 (const SAString *str)
 Returns the UTF-8 string stored with SAString handle. More...
 
size_t sqlapi_string_utf8_length (const SAString *str)
 Returns the UTF-8 string length stored with SAString handle. More...
 
void sqlapi_string_set_utf8_string (SAString *str, const char *src, size_t len)
 Sets the UTF-8 string into SAString handle. More...
 
const void * sqlapi_string_binary (const SAString *str)
 Returns the binary data stored with SAString handle. More...
 
size_t sqlapi_string_binary_length (const SAString *str)
 Returns the binary data length stored with SAString handle. More...
 
void sqlapi_string_set_binary_string (SAString *str, const void *src, size_t len)
 Sets the binary data into SAString handle. More...
 
SANumericsqlapi_alloc_numeric (const SANumeric *src)
 Allocates new numeric handle. More...
 
void sqlapi_free_numeric (SANumeric **pnum)
 Releases the numeric handle. More...
 
SAStringsqlapi_numeric_string (const SANumeric *num)
 Converts SANumeric handle value into SAString. More...
 
unsigned char sqlapi_numeric_precision (const SANumeric *num)
 Returns SANumeric precision. More...
 
unsigned char sqlapi_numeric_scale (const SANumeric *num)
 Returns SANumeric scale. More...
 
unsigned char sqlapi_numeric_sign (const SANumeric *num)
 Returns SANumeric sign. More...
 
double sqlapi_numeric_double (const SANumeric *num)
 Converts SANumeric handle value into double. More...
 
sa_int64_t sqlapi_numeric_int64 (const SANumeric *num)
 Converts SANumeric handle value into 64-bit integer. More...
 
sa_uint64_t sqlapi_numeric_uint64 (const SANumeric *num)
 Converts SANumeric handle value into unsigned 64-bit integer. More...
 
void sqlapi_numeric_set_string (SANumeric *num, const SAChar *val)
 Converts character string into SANumeric handle value. More...
 
void sqlapi_numeric_set_double (SANumeric *num, double val)
 Converts double into SANumeric handle value. More...
 
void sqlapi_numeric_set_int64 (SANumeric *num, sa_int64_t val)
 Converts 64-bit integer into SANumeric handle value. More...
 
void sqlapi_numeric_set_uint64 (SANumeric *num, sa_uint64_t val)
 Converts unsigned 64-bit integer into SANumeric handle value. More...
 
SADateTimesqlapi_alloc_datetime (const SADateTime *src)
 Allocates new datetime handle. More...
 
void sqlapi_free_datetime (SADateTime **pdt)
 Releases the datetime handle. More...
 
SAStringsqlapi_datetime_string (const SADateTime *dt)
 Converts SADateTime handle value into SAString. More...
 
struct tm sqlapi_datetime_tm (const SADateTime *dt)
 Converts SADateTime handle value into struct tm. More...
 
double sqlapi_datetime_double (const SADateTime *dt)
 Converts SADateTime handle value into double. More...
 
int sqlapi_datetime_year (const SADateTime *dt)
 Returns the year of SADateTime handle value. More...
 
int sqlapi_datetime_month (const SADateTime *dt)
 Returns the month of SADateTime handle value. More...
 
int sqlapi_datetime_day (const SADateTime *dt)
 Returns the day of SADateTime handle value. More...
 
int sqlapi_datetime_week_day (const SADateTime *dt)
 Returns the week day of SADateTime handle value. More...
 
int sqlapi_datetime_year_day (const SADateTime *dt)
 Returns the year day of SADateTime handle value. More...
 
int sqlapi_datetime_hour (const SADateTime *dt)
 Returns the hour of SADateTime handle value. More...
 
int sqlapi_datetime_min (const SADateTime *dt)
 Returns the minute of SADateTime handle value. More...
 
int sqlapi_datetime_sec (const SADateTime *dt)
 Returns the second of SADateTime handle value. More...
 
const SACharsqlapi_datetime_timezone (const SADateTime *dt)
 Returns the timezone of SADateTime handle value. More...
 
unsigned int sqlapi_datetime_fraction (const SADateTime *dt)
 Returns the fraction of SADateTime handle value. More...
 
void sqlapi_datetime_set_tm (SADateTime *dt, struct tm val)
 Converts struct tm into SADateTime handle value. More...
 
void sqlapi_datetime_set_double (SADateTime *dt, double val)
 Converts double into SADateTime handle value. More...
 
void sqlapi_datetime_set_datetime (SADateTime *dt, int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, unsigned int nFraction, const SAChar *timezone)
 Sets SADateTime handle datetime value.
 
void sqlapi_datetime_set_date (SADateTime *dt, int nYear, int nMonth, int nDay)
 Sets SADateTime handle date value.
 
void sqlapi_datetime_set_time (SADateTime *dt, int nHour, int nMin, int nSec, unsigned int nFraction)
 Sets SADateTime handle time value.
 
SABool_t sqlapi_datetime_has_date (const SADateTime *dt)
 Checks if SADateTime handle value has date part.
 
SABool_t sqlapi_datetime_has_time (const SADateTime *dt)
 Checks if SADateTime handle value has time part.
 

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 Anywhere 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

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_ClientVersionOld 

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 data types.

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 Oracle only)

SA_dtSpecificToDBMS 

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

◆ SACommandType_t

SACommand type.

Describes a set of possible types of SACommand. 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 established.

◆ SABool_t

enum SABool_t

Enum describes possible result returned by the Library C function.

Enumerator
SA_ReturnError 

Error occurred.

SA_False 

TRUE value.

SA_True 

FALSE value.

Function Documentation

◆ sqlapi_alloc_error()

SAException* sqlapi_alloc_error ( )

Allocates the Library error handle.

This function allocates SAException* handle that can be used for getting error details.

After the work is done the received error handle should be released with sqlapi_free_error function.

◆ sqlapi_free_error()

void sqlapi_free_error ( SAException **  perr)

Releases all error handle related resources.

Function checks that the parameter passed to it points to non-zero handle.

After all handle related structures are successfully released the handle pointer is set to 0.

...
sqlapi_free_error(&err);

◆ sqlapi_error_text()

SAString* sqlapi_error_text ( const SAException err)

Gets the SAException error text.

This function returns the error text for related SAException* handle.

See also
SAException::ErrText

◆ sqlapi_error_message()

const SAChar* sqlapi_error_message ( const SAException err)

Gets the SAException error message.

This function returns the error message associated with SAException* handle.

See also
SAException::ErrText

◆ sqlapi_error_native_code()

int sqlapi_error_native_code ( const SAException err)

Gets the SAException error native code.

This function returns DBMS error native code associated with SAException* handle.

See also
SAException::ErrNativeCode

◆ sqlapi_error_pos()

int sqlapi_error_pos ( const SAException err)

Gets the SAException error position.

This function returns DBMS error position associated with SAException* handle.

See also
SAException::ErrPos

◆ sqlapi_error_class()

SAErrorClass_t sqlapi_error_class ( const SAException err)

Gets the SAException error class.

This function returns the error class associated with SAException* handle.

See also
SAException::ErrClass

◆ sqlapi_error_nested()

const SAException* sqlapi_error_nested ( const SAException err)

Gets the SAException nested error.

This function returns the nested error associated with SAException* handle.

See also
SAException::NestedException

◆ sqlapi_alloc_api()

SAPI* sqlapi_alloc_api ( )

Allocates new API handle.

After the work is done the received API handle should be released with sqlapi_free function.

◆ sqlapi_free_api()

void sqlapi_free_api ( SAPI **  papi)

Releases all API handle related resources.

Function checks that the parameter passed to it points to non-zero handle.

After all handle related structures are successfully released the handle pointer is set to 0.

◆ sqlapi_set_api_option()

void sqlapi_set_api_option ( SAPI api,
const SAChar szOption,
const SAChar szValue 
)

Sets SAPI handle option.

See also
SAPI::setOption

◆ sqlapi_init()

SAErrorClass_t sqlapi_init ( SAPI api,
SAClient_t  type,
SAException err 
)

Initializes SAPI handle with specified DBMS client type.

Parameters
apiSAPI handle for initialization
typeDBMS client type
errThe error handle for the detailed diagnostic or 0
Returns
SA_No_Error if success, actual error class if failure.

◆ sqlapi_alloc_connection()

SAConnection* sqlapi_alloc_connection ( SAPI api)

Allocates new connection handle.

After the work is done the received connection handle should be released with sqlapi_free_connection function.

◆ sqlapi_free_connection()

void sqlapi_free_connection ( SAConnection **  pcon)

Releases all connection handle related resources.

Function checks that the parameter passed to it points to non-zero handle.

After all handle related structures are successfully released the handle pointer is set to 0.

◆ sqlapi_set_connection_option()

void sqlapi_set_connection_option ( SAConnection conn,
const SAChar szOption,
const SAChar szValue 
)

Sets SAConnection handle option.

See also
SAConnection::setOption

◆ sqlapi_connect()

SAErrorClass_t sqlapi_connect ( SAConnection conn,
const SAChar szConnectionStr,
const SAChar szUser,
const SAChar szPassword,
SAException err 
)

Connects SAConnection handle.

Parameters
connThe connection handle
szConnectionStrThe connection string (DBMS specific)
szUserThe username (or an empty string for OS authentication if supported)
szPasswordThe password
errThe error handle for the detailed diagnostic or 0
See also
SAConnection::Connect

◆ sqlapi_disconnect()

SAErrorClass_t sqlapi_disconnect ( SAConnection conn,
SAException err 
)

Disconnects SAConnection handle.

Parameters
connThe connection handle
errThe error handle for the detailed diagnostic or 0
See also
SAConnection::Disconnect

◆ sqlapi_is_connected()

SABool_t sqlapi_is_connected ( SAConnection conn,
SAException err 
)

Checks if SAConnection is connected.

Parameters
connThe connection handle
errThe error handle for the detailed diagnostic or 0
See also
SAConnection::isConnected

◆ sqlapi_is_alive()

SABool_t sqlapi_is_alive ( SAConnection conn,
SAException err 
)

Checks if SAConnection is alive.

Parameters
connThe connection handle
errThe error handle for the detailed diagnostic or 0
See also
SAConnection::isAlive

◆ sqlapi_reset_connection()

void sqlapi_reset_connection ( SAConnection conn)

Resets SAConnection handle.

Parameters
connThe connection handle
See also
SAConnection::Reset

◆ sqlapi_commit()

SAErrorClass_t sqlapi_commit ( SAConnection conn,
SAException err 
)

Commits the database session changes.

Parameters
connThe connection handle
errThe error handle for the detailed diagnostic or 0
See also
SAConnection::Commit

◆ sqlapi_rollback()

SAErrorClass_t sqlapi_rollback ( SAConnection conn,
SAException err 
)

Rollbacks the database session changes.

Parameters
connThe connection handle
errThe error handle for the detailed diagnostic or 0
See also
SAConnection::Rollback

◆ sqlapi_set_auto_commit()

SAErrorClass_t sqlapi_set_auto_commit ( SAConnection conn,
SAAutoCommit_t  mode,
SAException err 
)

Changes the database session auto-commit mode.

Parameters
connThe connection handle
modeThe auto-commit mode
errThe error handle for the detailed diagnostic or 0
See also
SAConnection::setAutoCommit

◆ sqlapi_set_isolation_level()

SAErrorClass_t sqlapi_set_isolation_level ( SAConnection conn,
SAIsolationLevel_t  level,
SAException err 
)

Changes the database session isolation level.

Parameters
connThe connection handle
modeThe isolation level
errThe error handle for the detailed diagnostic or 0
See also
SAConnection::setIsolationLevel

◆ sqlapi_alloc_command()

SACommand* sqlapi_alloc_command ( SAConnection conn)

Allocates new command handle.

Parameters
connThe SAConnection handle

After the work is done the received command handle should be released with sqlapi_free_command function.

◆ sqlapi_free_command()

void sqlapi_free_command ( SACommand **  pcmd)

Releases all command handle related resources.

Function checks that the parameter passed to it points to non-zero handle.

After all handle related structures are successfully released the handle pointer is set to 0.

◆ sqlapi_set_command_option()

void sqlapi_set_command_option ( SACommand cmd,
const SAChar szOption,
const SAChar szValue 
)

Sets SACommand handle option.

See also
SACommand::setOption

◆ sqlapi_execute()

SAErrorClass_t sqlapi_execute ( SACommand cmd,
const SAChar szQuery,
SAException err 
)

Executes SQL command.

Parameters
connThe connection handle
szQuerySQL command (or 0 - then he previously prepared command executed again)
errThe error handle for the detailed diagnostic or 0

◆ sqlapi_reset_command()

void sqlapi_reset_command ( SACommand cmd)

Resets SACommand handle.

Parameters
cmdThe command handle
See also
SACommand::Reset

◆ sqlapi_is_result_set()

SABool_t sqlapi_is_result_set ( SACommand cmd,
SAException err 
)

Checks if any result set exists.

Parameters
cmdThe command handle
errThe error handle for the detailed diagnostic or 0
See also
SACommand::isResultSet

◆ sqlapi_fetch_next()

SABool_t sqlapi_fetch_next ( SACommand cmd,
SAException err 
)

Fetches next row of the result set.

Parameters
cmdThe command handle
errThe error handle for the detailed diagnostic or 0
See also
SACommand::FetchNext

◆ sqlapi_fetch_prior()

SABool_t sqlapi_fetch_prior ( SACommand cmd,
SAException err 
)

Fetches previous row of the result set.

Parameters
cmdThe command handle
errThe error handle for the detailed diagnostic or 0
See also
SACommand::FetchPrior

◆ sqlapi_fetch_first()

SABool_t sqlapi_fetch_first ( SACommand cmd,
SAException err 
)

Fetches the first row of the result set.

Parameters
cmdThe command handle
errThe error handle for the detailed diagnostic or 0
See also
SACommand::FetchFirst

◆ sqlapi_fetch_last()

SABool_t sqlapi_fetch_last ( SACommand cmd,
SAException err 
)

Fetches the last row of the result set.

Parameters
cmdThe command handle
errThe error handle for the detailed diagnostic or 0
See also
SACommand::FetchLast

◆ sqlapi_fetch_pos()

SABool_t sqlapi_fetch_pos ( SACommand cmd,
int  offset,
SABool_t  relative,
SAException err 
)

Fetches the specified row of the result set.

Parameters
cmdThe command handle
offsetThe row offset
relativeThe offset specified is relative or absolute
errThe error handle for the detailed diagnostic or 0
See also
SACommand::FetchPos

◆ sqlapi_param_count()

int sqlapi_param_count ( SACommand cmd,
SAException err 
)

Returns the command parameters count.

Parameters
cmdThe command handle
errThe error handle for the detailed diagnostic or 0
See also
SACommand::ParamCount

◆ sqlapi_param_by_index()

SAParam* sqlapi_param_by_index ( SACommand cmd,
int  nIndex,
SAException err 
)

Returns SAParam handle.

Parameters
cmdThe command handle
nIndexThe index of the parameter
errThe error handle for the detailed diagnostic or 0
See also
SACommand::ParamByIndex

◆ sqlapi_param()

SAParam* sqlapi_param ( SACommand cmd,
int  nParamByID,
SAException err 
)

Returns parameter handle.

Parameters
cmdThe command handle
nParamByIDThe parameter index
errThe error handle for the detailed diagnostic or 0

◆ sqlapi_param_by_name()

SAParam* sqlapi_param_by_name ( SACommand cmd,
const SAChar szParamByName,
SAException err 
)

Returns SAParam handle.

Parameters
cmdThe command handle
nIndexThe name of the parameter
errThe error handle for the detailed diagnostic or 0
See also
SACommand::Param

◆ sqlapi_param_type()

SADataType_t sqlapi_param_type ( const SAParam par)

Returns SAParam type.

Parameters
parThe parameter handle
See also
SAParam::ParamType

◆ sqlapi_param_native_type()

int sqlapi_param_native_type ( const SAParam par)

Returns SAParam native type.

Parameters
parThe parameter handle
See also
SAParam::ParamNativeType

◆ sqlapi_param_direction()

SAParamDirType_t sqlapi_param_direction ( const SAParam par)

Returns SAParam direction.

Parameters
parThe parameter handle
See also
SAParam::ParamDirType

◆ sqlapi_param_size()

size_t sqlapi_param_size ( const SAParam par)

Returns SAParam size.

Parameters
parThe parameter handle
See also
SAParam::ParamSize

◆ sqlapi_param_precision()

int sqlapi_param_precision ( const SAParam par)

Returns SAParam precision.

Parameters
parThe parameter handle
See also
SAParam::ParamPrecision

◆ sqlapi_param_scale()

int sqlapi_param_scale ( const SAParam par)

Returns SAParam scale.

Parameters
parThe parameter handle
See also
SACommand::ParamScale

◆ sqlapi_param_value()

const SAValueRead* sqlapi_param_value ( SACommand cmd,
int  nParamByID,
SAException err 
)

Returns parameter value handle.

Parameters
cmdThe command handle
nParamByIDThe parameter index
errThe error handle for the detailed diagnostic or 0

◆ sqlapi_param_value_by_name()

const SAValueRead* sqlapi_param_value_by_name ( SACommand cmd,
const SAChar szParamByName,
SAException err 
)

Returns parameter value handle.

Parameters
cmdThe command handle
szParamByNameThe parameter name
errThe error handle for the detailed diagnostic or 0

◆ sqlapi_param_set_short()

void sqlapi_param_set_short ( SAParam par,
short  val 
)

Sets the parameter value as short integer.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_param_set_ushort()

void sqlapi_param_set_ushort ( SAParam par,
unsigned short  val 
)

Sets the parameter value as unsigned short integer.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_param_set_int32()

void sqlapi_param_set_int32 ( SAParam par,
long  val 
)

Sets the parameter value as long integer.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_param_set_uint32()

void sqlapi_param_set_uint32 ( SAParam par,
unsigned long  val 
)

Sets the parameter value as unsigned long integer.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_param_set_int64()

void sqlapi_param_set_int64 ( SAParam par,
sa_int64_t  val 
)

Sets the parameter value as 64-bit integer.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_param_set_uint64()

void sqlapi_param_set_uint64 ( SAParam par,
sa_uint64_t  val 
)

Sets the parameter value as unsigned 64-bit integer.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_param_set_string()

void sqlapi_param_set_string ( SAParam par,
const SAString val 
)

Sets the parameter value as string.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_param_set_numeric()

void sqlapi_param_set_numeric ( SAParam par,
const SANumeric val 
)

Sets the parameter value as numeric.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_param_set_datetime()

void sqlapi_param_set_datetime ( SAParam par,
const SADateTime val 
)

Sets the parameter value as date/time.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_param_set_double()

void sqlapi_param_set_double ( SAParam par,
double  val 
)

Sets the parameter value as double.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_param_set_bytes()

void sqlapi_param_set_bytes ( SAParam par,
const SAString val 
)

Sets the parameter value as binary data.

Parameters
parThe parameter handle
valThe parameter value

◆ sqlapi_field_count()

int sqlapi_field_count ( SACommand cmd,
SAException err 
)

Returns the result set field count.

Parameters
cmdThe command handle
errThe error handle for the detailed diagnostic or 0
See also
SACommand::FieldCount

◆ sqlapi_field()

const SAField* sqlapi_field ( SACommand cmd,
int  nField,
SAException err 
)

Returns the result set field handle.

Parameters
cmdThe command handle
nFieldThe field index (starts with 1)
errThe error handle for the detailed diagnostic or 0
See also
SACommand::Field

◆ sqlapi_field_value()

const SAValueRead* sqlapi_field_value ( SACommand cmd,
int  nField,
SAException err 
)

Returns the result set field value handle.

Parameters
cmdThe command handle
nFieldThe field index
errThe error handle for the detailed diagnostic or 0

◆ sqlapi_field_by_name()

const SAField* sqlapi_field_by_name ( SACommand cmd,
const SAChar szField,
SAException err 
)

Returns the result set field handle.

Parameters
cmdThe command handle
szFieldThe field name
errThe error handle for the detailed diagnostic or 0
See also
SACommand::Field

◆ sqlapi_field_value_by_name()

const SAValueRead* sqlapi_field_value_by_name ( SACommand cmd,
const SAChar szField,
SAException err 
)

Returns the result set field value handle.

Parameters
cmdThe command handle
szFieldThe field name
errThe error handle for the detailed diagnostic or 0

◆ sqlapi_field_name()

const SAChar* sqlapi_field_name ( const SAField field)

Returns SAField name.

Parameters
fieldThe field handle
See also
SAField::Name

◆ sqlapi_field_type()

SADataType_t sqlapi_field_type ( const SAField field)

Returns SAField type.

Parameters
fieldThe field handle
See also
SAField::FieldType

◆ sqlapi_field_native_type()

int sqlapi_field_native_type ( const SAField field)

Returns SAField native type.

Parameters
fieldThe field handle
See also
SAField::FieldNativeType

◆ sqlapi_field_data_size()

size_t sqlapi_field_data_size ( const SAField field)

Returns SAField size.

Parameters
fieldThe field handle
See also
SAField::FieldSize

◆ sqlapi_field_precision()

int sqlapi_field_precision ( const SAField field)

Returns SAField precision.

Parameters
fieldThe field handle
See also
SAField::FieldPrecision

◆ sqlapi_field_scale()

int sqlapi_field_scale ( const SAField field)

Returns SAField scale.

Parameters
fieldThe field handle
See also
SAField::FieldScale

◆ sqlapi_value_as_short()

short sqlapi_value_as_short ( const SAValueRead val)

Returns the short value.

Parameters
valThe value handle

◆ sqlapi_value_as_ushort()

unsigned short sqlapi_value_as_ushort ( const SAValueRead val)

Returns the unsigned short value.

Parameters
valThe value handle

◆ sqlapi_value_as_int32()

long sqlapi_value_as_int32 ( const SAValueRead val)

Returns the 32-bit integer value.

Parameters
valThe value handle

◆ sqlapi_value_as_uint32()

unsigned long sqlapi_value_as_uint32 ( const SAValueRead val)

Returns the unsigned 32-bit integer value.

Parameters
valThe value handle

◆ sqlapi_value_as_int64()

sa_int64_t sqlapi_value_as_int64 ( const SAValueRead val)

Returns the 64-bit integer value.

Parameters
valThe value handle

◆ sqlapi_value_as_uint64()

sa_uint64_t sqlapi_value_as_uint64 ( const SAValueRead val)

Returns the unsigned 64-bit integer value.

Parameters
valThe value handle

◆ sqlapi_value_as_string()

SAString* sqlapi_value_as_string ( const SAValueRead val)

Returns the string value.

Parameters
valThe value handle

◆ sqlapi_value_as_numeric()

SANumeric* sqlapi_value_as_numeric ( const SAValueRead val)

Returns the numeric value.

Parameters
valThe value handle

◆ sqlapi_value_as_datetime()

SADateTime* sqlapi_value_as_datetime ( const SAValueRead val)

Returns the date/time value.

Parameters
valThe value handle

◆ sqlapi_value_as_double()

double sqlapi_value_as_double ( const SAValueRead val)

Returns the double value.

Parameters
valThe value handle

◆ sqlapi_value_as_cursor()

const SACommand* sqlapi_value_as_cursor ( const SAValueRead val)

Returns the resultset associated with the value.

Parameters
valThe value handle

◆ sqlapi_value_as_bytes()

SAString* sqlapi_value_as_bytes ( const SAValueRead val)

Returns the binary data of the value.

Parameters
valThe value handle

◆ sqlapi_alloc_string()

SAString* sqlapi_alloc_string ( const SAString src)

Allocates new string handle.

After the work is done the received string handle should be released with sqlapi_free_string function.

◆ sqlapi_free_string()

void sqlapi_free_string ( SAString **  pstr)

Releases the string handle.

Function checks that the parameter passed to it points to non-zero handle.

After all handle related structures are successfully released the handle pointer is set to 0.

◆ sqlapi_string_mb()

const char* sqlapi_string_mb ( const SAString str)

Returns the multi-byte string stored with SAString handle.

Parameters
strThe string handle

◆ sqlapi_string_mb_length()

size_t sqlapi_string_mb_length ( const SAString str)

Returns the multi-byte string length stored with SAString handle.

Parameters
strThe string handle

◆ sqlapi_string_set_mb_string()

void sqlapi_string_set_mb_string ( SAString str,
const char *  src,
size_t  len 
)

Sets the multi-byte string into SAString handle.

Parameters
strThe string handle
srcThe source multi-byte string
lenThe source string data length

◆ sqlapi_string_wide()

const wchar_t* sqlapi_string_wide ( const SAString str)

Returns the wide string stored with SAString handle.

Parameters
strThe string handle

◆ sqlapi_string_wide_length()

size_t sqlapi_string_wide_length ( const SAString str)

Returns the wide string length stored with SAString handle.

Parameters
strThe string handle

◆ sqlapi_string_set_wide_string()

void sqlapi_string_set_wide_string ( SAString str,
const wchar_t *  src,
size_t  len 
)

Sets the wide string into SAString handle.

Parameters
strThe string handle
srcThe source wide string
lenThe source string data length

◆ sqlapi_string_utf8()

const char* sqlapi_string_utf8 ( const SAString str)

Returns the UTF-8 string stored with SAString handle.

Parameters
strThe string handle

◆ sqlapi_string_utf8_length()

size_t sqlapi_string_utf8_length ( const SAString str)

Returns the UTF-8 string length stored with SAString handle.

Parameters
strThe string handle

◆ sqlapi_string_set_utf8_string()

void sqlapi_string_set_utf8_string ( SAString str,
const char *  src,
size_t  len 
)

Sets the UTF-8 string into SAString handle.

Parameters
strThe string handle
srcThe source UTF-8 string
lenThe source string data length

◆ sqlapi_string_binary()

const void* sqlapi_string_binary ( const SAString str)

Returns the binary data stored with SAString handle.

Parameters
strSAString handle

◆ sqlapi_string_binary_length()

size_t sqlapi_string_binary_length ( const SAString str)

Returns the binary data length stored with SAString handle.

Parameters
strSAString handle

◆ sqlapi_string_set_binary_string()

void sqlapi_string_set_binary_string ( SAString str,
const void *  src,
size_t  len 
)

Sets the binary data into SAString handle.

Parameters
strSAString handle
srcThe source binary buffer
lenThe source binary buffer length

◆ sqlapi_alloc_numeric()

SANumeric* sqlapi_alloc_numeric ( const SANumeric src)

Allocates new numeric handle.

After the work is done the received numeric handle should be released with sqlapi_free_numeric function.

◆ sqlapi_free_numeric()

void sqlapi_free_numeric ( SANumeric **  pnum)

Releases the numeric handle.

Function checks that the parameter passed to it points to non-zero handle.

After all handle related structures are successfully released the handle pointer is set to 0.

◆ sqlapi_numeric_string()

SAString* sqlapi_numeric_string ( const SANumeric num)

Converts SANumeric handle value into SAString.

After the work is done the received SAString handle should be released with sqlapi_free function.

◆ sqlapi_numeric_precision()

unsigned char sqlapi_numeric_precision ( const SANumeric num)

Returns SANumeric precision.

Parameters
numSANumeric handle

◆ sqlapi_numeric_scale()

unsigned char sqlapi_numeric_scale ( const SANumeric num)

Returns SANumeric scale.

Parameters
numSANumeric handle

◆ sqlapi_numeric_sign()

unsigned char sqlapi_numeric_sign ( const SANumeric num)

Returns SANumeric sign.

Parameters
numSANumeric handle

◆ sqlapi_numeric_double()

double sqlapi_numeric_double ( const SANumeric num)

Converts SANumeric handle value into double.

Parameters
numSANumeric handle

◆ sqlapi_numeric_int64()

sa_int64_t sqlapi_numeric_int64 ( const SANumeric num)

Converts SANumeric handle value into 64-bit integer.

Parameters
numSANumeric handle

◆ sqlapi_numeric_uint64()

sa_uint64_t sqlapi_numeric_uint64 ( const SANumeric num)

Converts SANumeric handle value into unsigned 64-bit integer.

Parameters
numSANumeric handle

◆ sqlapi_numeric_set_string()

void sqlapi_numeric_set_string ( SANumeric num,
const SAChar val 
)

Converts character string into SANumeric handle value.

Parameters
numSANumeric handle
valcharacter string

◆ sqlapi_numeric_set_double()

void sqlapi_numeric_set_double ( SANumeric num,
double  val 
)

Converts double into SANumeric handle value.

Parameters
numSANumeric handle
valcharacter string

◆ sqlapi_numeric_set_int64()

void sqlapi_numeric_set_int64 ( SANumeric num,
sa_int64_t  val 
)

Converts 64-bit integer into SANumeric handle value.

Parameters
numSANumeric handle
valcharacter string

◆ sqlapi_numeric_set_uint64()

void sqlapi_numeric_set_uint64 ( SANumeric num,
sa_uint64_t  val 
)

Converts unsigned 64-bit integer into SANumeric handle value.

Parameters
numSANumeric handle
valcharacter string

◆ sqlapi_alloc_datetime()

SADateTime* sqlapi_alloc_datetime ( const SADateTime src)

Allocates new datetime handle.

After the work is done the received datetime handle should be released with sqlapi_free_datetime function.

◆ sqlapi_free_datetime()

void sqlapi_free_datetime ( SADateTime **  pdt)

Releases the datetime handle.

Function checks that the parameter passed to it points to non-zero handle.

After all handle related structures are successfully released the handle pointer is set to 0.

◆ sqlapi_datetime_string()

SAString* sqlapi_datetime_string ( const SADateTime dt)

Converts SADateTime handle value into SAString.

After the work is done the received SAString handle should be released with sqlapi_free function.

◆ sqlapi_datetime_tm()

struct tm sqlapi_datetime_tm ( const SADateTime dt)

Converts SADateTime handle value into struct tm.

Parameters
dtSADateTime handle

◆ sqlapi_datetime_double()

double sqlapi_datetime_double ( const SADateTime dt)

Converts SADateTime handle value into double.

Parameters
dtSADateTime handle

◆ sqlapi_datetime_year()

int sqlapi_datetime_year ( const SADateTime dt)

Returns the year of SADateTime handle value.

Parameters
dtSADateTime handle
See also
SADateTime::GetYear

◆ sqlapi_datetime_month()

int sqlapi_datetime_month ( const SADateTime dt)

Returns the month of SADateTime handle value.

Parameters
dtSADateTime handle
See also
SADateTime::GetMonth

◆ sqlapi_datetime_day()

int sqlapi_datetime_day ( const SADateTime dt)

Returns the day of SADateTime handle value.

Parameters
dtSADateTime handle
See also
SADateTime::GetDay

◆ sqlapi_datetime_week_day()

int sqlapi_datetime_week_day ( const SADateTime dt)

Returns the week day of SADateTime handle value.

Parameters
dtSADateTime handle
See also
SADateTime::GetDayOfWeek

◆ sqlapi_datetime_year_day()

int sqlapi_datetime_year_day ( const SADateTime dt)

Returns the year day of SADateTime handle value.

Parameters
dtSADateTime handle
See also
SADateTime::GetDayOfYear

◆ sqlapi_datetime_hour()

int sqlapi_datetime_hour ( const SADateTime dt)

Returns the hour of SADateTime handle value.

Parameters
dtSADateTime handle
See also
SADateTime::GetHour

◆ sqlapi_datetime_min()

int sqlapi_datetime_min ( const SADateTime dt)

Returns the minute of SADateTime handle value.

Parameters
dtSADateTime handle
See also
SADateTime::GetHour

◆ sqlapi_datetime_sec()

int sqlapi_datetime_sec ( const SADateTime dt)

Returns the second of SADateTime handle value.

Parameters
dtSADateTime handle
See also
SADateTime::GetSecond

◆ sqlapi_datetime_timezone()

const SAChar* sqlapi_datetime_timezone ( const SADateTime dt)

Returns the timezone of SADateTime handle value.

Parameters
dtSADateTime handle
See also
SADateTime::Timezone

◆ sqlapi_datetime_fraction()

unsigned int sqlapi_datetime_fraction ( const SADateTime dt)

Returns the fraction of SADateTime handle value.

Parameters
dtSADateTime handle
See also
SADateTime::Fraction

◆ sqlapi_datetime_set_tm()

void sqlapi_datetime_set_tm ( SADateTime dt,
struct tm  val 
)

Converts struct tm into SADateTime handle value.

Parameters
dtSADateTime handle
valstruct tm

◆ sqlapi_datetime_set_double()

void sqlapi_datetime_set_double ( SADateTime dt,
double  val 
)

Converts double into SADateTime handle value.

Parameters
dtSADateTime handle
valstruct tm