Defines a specific command result set field that you read the value. More...
Inherits SAValueRead, and SAOptions.
Public Member Functions | |
int | Pos () const |
Returns a one-based position of the field in a result set. | |
const SAString & | Name () const |
Returns name of the field. | |
SADataType_t | FieldType () const |
Returns field data type. | |
int | FieldNativeType () const |
Returns native code of field data type. More... | |
size_t | FieldSize () const |
Returns field data size. | |
int | FieldPrecision () const |
Returns precision of the field value. More... | |
int | FieldScale () const |
Returns scale of the field value. More... | |
bool | isFieldRequired () const |
Shows if it is possible for the field value to be null. More... | |
void | setFieldSize (int nSize) |
Sets parameter's data size. | |
void | setFieldType (SADataType_t eType) |
Sets the fields's data type. | |
void | ReadLongOrLob (saLongOrLobReader_t fnReader, size_t nReaderWantedSize, void *pAddlData) |
Starts reading of Long or BLob(CLob) value using user defined callback. More... | |
Public Member Functions inherited from SAValueRead | |
SAValueRead (SADataType_t eDataType) | |
Initializes the object with specified data type. | |
SAValueRead (const SAValueRead &vr) | |
Copy constructor. | |
SAValueRead & | operator= (const SAValueRead &vr) |
Copy operator. | |
SADataType_t | DataType () const |
Returns the object's data type. | |
bool | isNull () const |
Returns true if the value of current object is NULL; otherwise false. | |
void | setLongOrLobReaderMode (SALongOrLobReaderModes_t eMode) |
Sets Long or Lob data reading mode. | |
SALongOrLobReaderModes_t | LongOrLobReaderMode () const |
Returns Long or Lob data reading mode. | |
bool | asBool () const |
Returns the value of current object. More... | |
short | asShort () const |
Returns the value of current object. More... | |
unsigned short | asUShort () const |
Returns the value of current object. More... | |
sa_int32_t | asInt32 () const |
Returns the value of current object. More... | |
sa_uint32_t | asUInt32 () const |
Returns the value of current object. More... | |
sa_int32_t | asLong () const |
Returns the value of current object. More... | |
sa_uint32_t | asULong () const |
Returns the value of current object. More... | |
sa_int64_t | asInt64 () const |
Returns the value of current object. More... | |
sa_uint64_t | asUInt64 () const |
Returns the value of current object. More... | |
double | asDouble () const |
Returns the value of current object. More... | |
SANumeric | asNumeric () const |
Returns the value of current object. More... | |
SADateTime | asDateTime () const |
Returns the value of current object. More... | |
SAInterval | asInterval () const |
Returns the value of current object. More... | |
SAString | asString () const |
Returns the value of current object. More... | |
SAString | asBytes () const |
Returns the value of current object. More... | |
SAString | asLongBinary () const |
Returns the value of current object. More... | |
SAString | asLongChar () const |
Returns the value of current object. More... | |
SAString | asBLob () const |
Returns the value of current object. More... | |
SAString | asCLob () const |
Returns the value of current object. More... | |
SACommand * | asCursor () const |
Returns the value of current object. More... | |
operator bool () const | |
Returns the value of current object. More... | |
operator short () const | |
Returns the value of current object. More... | |
operator unsigned short () const | |
Returns the value of current object. More... | |
operator sa_int32_t () const | |
Returns the value of current object. More... | |
operator sa_uint32_t () const | |
Returns the value of current object. More... | |
operator sa_int64_t () const | |
Returns the value of current object. More... | |
operator sa_uint64_t () const | |
Returns the value of current object. More... | |
operator double () const | |
Returns the value of current object. More... | |
operator SANumeric () const | |
Returns the value of current object. More... | |
operator SADateTime () const | |
Returns the value of current object. More... | |
operator SAInterval () const | |
Returns the value of current object. More... | |
operator SAString () const | |
Returns the value of current object. More... | |
operator SACommand * () const | |
Returns the value of current object. More... | |
Public Member Functions inherited from SAOptions | |
SAOptions () | |
Default constructor. | |
virtual SAString & | setOption (const SAString &sOptionName) |
Sets a string value of a specific option. More... | |
virtual int | TotalOptions () const |
Returns the count of options. | |
virtual SAString | OptionName (int nIndex) const |
Returns the string value of an option. | |
Detailed Description
Defines a specific command result set field that you read the value.
Member Function Documentation
◆ FieldNativeType()
int SAField::FieldNativeType | ( | ) | const |
Returns native code of field data type.
Returns native type code of the field.
- Remarks
- Use the method if you need to know the original data type code of the field as it was reported by native API.
◆ FieldPrecision()
int SAField::FieldPrecision | ( | ) | const |
Returns precision of the field value.
- Remarks
- Returns precision of the field value (the total number of allowable digits).
◆ FieldScale()
int SAField::FieldScale | ( | ) | const |
Returns scale of the field value.
- Remarks
- Returns scale of the field value(the number of digits to the right of the decimal point).
◆ isFieldRequired()
bool SAField::isFieldRequired | ( | ) | const |
Shows if it is possible for the field value to be null.
- Remarks
- Returns false if the field value can be null; true otherwise.
◆ ReadLongOrLob()
void SAField::ReadLongOrLob | ( | saLongOrLobReader_t | fnReader, |
size_t | nReaderWantedSize, | ||
void * | pAddlData | ||
) |
Starts reading of Long or BLob(CLob) value using user defined callback.
When you call SACommand::FetchNext method (after a command execution) all fields are updated by their values, including Long and BLob(CLob) fields.
If you want to control piecewise reading of Long or BLob(CLob) data you should do the following:
- After a command execution set SA_LongOrLobReaderManual reading mode (see SAValueRead::setLongOrLobReaderMode) or Long or BLob(CLob) fields you want to process by user defined function(s). After that each SACommand::FetchNext call will skip reading Long and BLob(CLob) fields that you set to be read manually.
- After calling SACommand::FetchNext method use ReadLongOrLob method for each field defined to be read manually.
ReadLongOrLob method will repeatedly call user defined function of type saLongOrLobReader_t.
To get more information about reading Long and BLob(CLob) data see Query examples - Step 6.
- Parameters
-
fnReader The name of user function used for Long or BLob(CLob) data reading. nReaderWantedSize Size of piece of data user want to get to callback function. pAddlData Additional data, passed to callback function.