const unsigned long FLAG_AUTO_INCREMENT = 1;
const unsigned long FLAG_CASE_SENSITIVE = 2;
const unsigned long FLAG_CURRENCY = 4;
const unsigned long FLAG_DEFINITELY_WRITABLE = 512;
const unsigned long FLAG_NOT_NULLABLE = 8;
const unsigned long FLAG_NULLABLE = 16;
const unsigned long FLAG_READONLY = 32;
const unsigned long FLAG_SEARCHABLE = 64;
const unsigned long FLAG_UNSIGNED = 128;
const unsigned long FLAG_WRITABLE = 256;
const long TYPE_BIGINT = -5;
const long TYPE_BINARY = -2;
const long TYPE_BIT = -7;
const long TYPE_BLOB = 2004;
const long TYPE_CHAR = 1;
const long TYPE_CLOB = 2005;
const long TYPE_DATE = 91;
const long TYPE_DECIMAL = 3;
const long TYPE_DOUBLE = 8;
const long TYPE_FLOAT = 6;
const long TYPE_INTEGER = 4;
const long TYPE_LONGVARBINARY = -4;
const long TYPE_LONGVARCHAR = -1;
const long TYPE_NUMERIC = 2;
const long TYPE_REAL = 7;
const long TYPE_SMALLINT = 5;
const long TYPE_TIME = 92;
const long TYPE_TIMESTAMP = 93;
const long TYPE_TINYINT = -6;
const long TYPE_VARBINARY = -3;
const long TYPE_VARCHAR = 12;
typedef sequence < BCD::Binary > BinarySeq;
typedef sequence < boolean > BooleanSeq;
A result column consists of meta data and data values, as well as a sequence indicating which rows contain null values. The length of 'nulls' may be less than the number of result rows. The default value if a row's 'nulls' entry is not present is false (i.e. non-null). This optimisation is particularly useful when the column's 'flags' contains the FLAG_NOT_NULLABLE bit.
struct Column
{
unsigned long flags;
unsigned long width;
unsigned long scale;
string name;
string label;
TabularResults::Data values;
TabularResults::BooleanSeq nulls;
};
The precision for floating-point decimal values is calculated as 'width - sign - dot', where sign = 1 if the flags bit FLAG_UNSIGNED is set (otherwise sign = 0), and dot = 1 if scale > 0 (otherwise dot = 0).
The scale must be zero for TYPE_BIGINT.
typedef sequence < TabularResults::Column > ColumnSeq;
The Data type represents an entire column in a result set.
Data is stored in a result set in column-major order. This means the
column data type (the union discriminator) only needs to be transmitted
over the network once, and minimises padding when using GIOP.
union Data switch (long)
{
case TYPE_BIT: TabularResults::BooleanSeq booleanValues;
case TYPE_TINYINT: TabularResults::OctetSeq octetValues;
case TYPE_SMALLINT: TabularResults::ShortSeq shortValues;
case TYPE_INTEGER: TabularResults::LongSeq longValues;
case TYPE_REAL: TabularResults::FloatSeq floatValues;
case TYPE_DOUBLE: case TYPE_FLOAT: TabularResults::DoubleSeq doubleValues;
case TYPE_CHAR: case TYPE_LONGVARCHAR: case TYPE_VARCHAR: case TYPE_CLOB: TabularResults::StringSeq stringValues;
case TYPE_BINARY: case TYPE_LONGVARBINARY: case TYPE_VARBINARY: case TYPE_BLOB: TabularResults::BinarySeq binaryValues;
case TYPE_BIGINT: case TYPE_DECIMAL: case TYPE_NUMERIC: TabularResults::DecimalSeq decimalValues;
case TYPE_DATE: TabularResults::DateSeq dateValues;
case TYPE_TIME: TabularResults::TimeSeq timeValues;
case TYPE_TIMESTAMP: TabularResults::TimestampSeq timestampValues;
};
Notes:
typedef sequence < MJD::Date > DateSeq;
typedef sequence < BCD::Decimal > DecimalSeq;
typedef sequence < double > DoubleSeq;
typedef sequence < float > FloatSeq;
typedef sequence < long > LongSeq;
typedef sequence < octet > OctetSeq;
The ResultSet type may be used as the return type
for an operation returning a single result set.
struct ResultSet
{
unsigned long rows;
TabularResults::ColumnSeq columns;
};
The ResultSets type may be used as the return type
for an operation returning multiple result sets.
typedef sequence < TabularResults::ResultSet > ResultSets;
typedef sequence < short > ShortSeq;
typedef sequence < string > StringSeq;
typedef sequence < MJD::Time > TimeSeq;
typedef sequence < MJD::Timestamp > TimestampSeq;