Home How To Online Documentation Support Download Order

 

 

 

SACommand
SAConnection
SAException
SAField
SAParam

SAString
SADateTime
SANumeric

Enums and Typedefs

  

Usage

Class Members

Examples

SAValueRead::asShort

SAValueRead::asUShort

short  asShort( ) const;
throw (SAException);

operator short( ) const;
throw (SAException);

unsigned short  asUShort( ) const;
throw (SAException);

operator unsigned short( ) const;
throw (SAException);

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

operator short() substitute asShort method to provide quick access for object's value.

asUShort method returns the value of current object (usually SAField or SAParam object) as unsigned short data.

operator unsigned short() substitute asUShort method to provide quick access for object's value.

Remarks

If the value of current object is NULL, asShort/asUShort method returns 0. Use SAValueRead::isNull method to make sure if the value is NULL or not.

If the value's type of current object is short/unsigned short (SA_dtShort/SA_dtUShort), asShort/asUShort method returns the original value with no conversion.

If the value's type of current object is bool (SA_dtBool ), long (SA_dtLong ), unsigned long (SA_dtULong ), double (SA_dtDouble) or numeric (SA_dtNumeric), asShort/asUShort method converts it to short/unsigned short data type. Note, that in this case the returned value can be truncated.

If the value's type of current object is string (SA_dtString), asShort/asUShort method tries to convert it to short/unsigned short value. If the conversion is possible and correct, asShort/asUShort returns SA_dtShort/SA_dtUShort value. If conversion is incorrect asShort/asUShort method throws an exception.

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, asBool, asLong, asDouble, asNumeric, 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.