Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Application Classes [Table of Contents] Error Processing

Sybase dbQueue Reference Guide

[-] Chapter 1: Using the dbQueue Objects Library
[-] Datatypes

Datatypes

The dbQueue objects library defines standard primitive datatypes used by library methods. These datatypes are defined in the DbqCommon.h header file, which also includes enumerated types and other definitions used throughout the library.

dbQueue datatypes fall into two categories:

The precise mapping of types into C++ types may vary by platform. Check the DbqCommon.h header file for the final mapping assignments.

C++ Only Datatypes

C++ datatypes include return codes and Boolean values.

Return Codes

dbQueue objects library methods that generate errors always return a DBQ_STATUS value. DBQ_STATUS values always equate to integer constants that fall into one of the following categories:

Boolean Values

The dbQueue objects library provides DBQ_BOOLEAN to represent TRUE and FALSE values. The following code sample shows how boolean values can be used:

if (env->GetAutoImplement() != DBQ_TRUE) 
    env->SetAutoImplement(DBQ_TRUE); 

The dbQueue implementation ensures that DBQ_FALSE and DBQ_TRUE equate to FALSE and TRUE respectively when they are used in C++ Boolean expressions. For example, applications can also be programmed as the following:

if (! env->GetAutoImplement())
    env->SetAutoImplement(DBQ_TRUE); 

Message Datatypes

These datatypes defined by dbQueue objects are typedefs of the C++ representation of the identically named dbQueue message datatypes. dbQueue datatypes generally map to ODBC datatypes.

Table 1-1 shows dbQueue datatypes mapping into C++ representations and ODBC datatype definitions.

Table 1-1: dbQueue datatype mapping to C++ and ODBC

dbQueue datatype Name

C++ Representation

ODBC Type Name

DBQ_BINARY

unsigned char*

SQL_C_BINARY

DBQ_BIT

unsigned char

SQL_C_BIT

DBQ_CHAR

unsigned char*

SQL_C_CHAR

DBQ_DATETIME

TIME_STAMP_STRUCT

SQL_C_TIMESTAMP

DBQ_DECIMAL

unsigned char*

SQL_C_DECIMAL

DBQ_FLOAT

double

SQL_C_DOUBLE

DBQ_IMAGE

unsigned char*

SQL_C_BINARY

DBQ_INTEGER

int

SQL_C_DOUBLE

DBQ_MONEY

unsigned char*

SQL_C_CHAR

DBQ_NUMERIC

unsigned char*

SQL_C_CHAR

DBQ_REAL

float

SQL_C_FLOAT

DBQ_SMALLDATETIME

TIMESTAMP_STRUCT

SQL_C_TIMESTAMP

DBQ_SMALLINT

short int

SQL_C_SSHORT

DBQ_SMALLMONEY

unsigned char*

SQL_C_CHAR

DBQ_TEXT

unsigned char*

SQL_C_CHAR

DBQ_TINYINT

signed char

SQL_C_STINYINT

DBQ_VARBINARY

unsigned char*

SQL_C_CHAR

DBQ_VARCHAR

unsigned char*

SQL_C_CHAR

For a full description of SQL datatypes and their values, see Appendix A, "Datatypes."


Application Classes [Table of Contents] Error Processing