Home How To Online Documentation Support Download Order

 

 

 

SACommand
SAConnection
SAException
SAField
SAParam

SAString
SADateTime
SANumeric

Enums and Typedefs

  

Usage

Class Members

Examples

SAValueRead::asBool

bool  asBool( ) const;
throw (SAException);

operator bool( ) const;
throw (SAException);

asBool method returns the value of current object (usually SAField or SAParam object) as bool data.

operator bool() substitute asBool method to provide quick access for object's value.

Remarks

If the value of current object is NULL, asBool method returns false. Use SAValueRead::isNull method to make sure if the value is NULL or not.

If the value's type of current object is bool (SA_dtBool), asBool method returns the original value with no conversion.

If the value's type of current object is short (SA_dtShort ), long (SA_dtLong) or double (SA_dtDouble), asBool method converts it to bool data type. Conversion returns false if the value is 0; true otherwise.

If the value's type of current object is any data type except the described above, the result is undefined and debug version asserts.

Use SAValueRead::DataType method to get the value's type of SAValueRead object.

Server specific notes

No specific information.

See also

isNull, asShort, asLong, asDouble, asDateTime, asString, asBytes, asLongBinary, asLongChar, asBLob, asCLob, asCursor, DataType

SADataType_t

Error handling

Problems and Questions

If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to howto@sqlapi.com.