Home How To Online Documentation Support Download Order

 

 

 

SACommand
SAConnection
SAException
SAField
SAParam

SAString
SADateTime
SANumeric

Enums and Typedefs

  

Usage

Class Members

Examples

SAValueRead::asString

SAString  asString( ) const;
throw (SAException);

operator SAString( ) const;
throw (SAException);

asString method returns the value of current object (usually SAField or SAParam object) as string (SAString) data.

operator SAString() substitute asString method to provide quick access for object's value.

Remarks

If the value of current object is NULL, asString method returns an empty string. 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), asString method returns "true" or "false" string (SAString object).

If the value's type of current object is short (SA_dtShort), asString method converts it to decimal string (SAString object) like function printf("%hd", ...) does.

If the value's type of current object is long (SA_dtLong), asString method converts it to decimal string (SAString object) like function printf("%ld", ...) does.

If the value's type of current object is double (SA_dtDouble), asString method converts it to decimal string (SAString object) like function printf("%g", ...) does.

If the value's type of current object is numeric (SA_dtNumeric), asString method converts it to decimal string (SAString object) without precision loss.

If the value's type of current object is date-time (SA_dtDateTime), asString method converts it to string (SAString object) like function asctime(...) does.

If the value's type of current object is string (SA_dtString, SA_dtLongChar, SA_dtCLob ), asString method returns the original object's value as SAString object.

If the value's type of current object is binary (SA_dtBytes, SA_dtLongBinary, SA_dtBLob), asString method converts it to hexadecimal string ( SAString object).

If the value's type of current object is cursor (SA_dtCursor), 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, asShort, asLong, asDouble, asNumeric, asDateTime, asBytes, asLongBinary, asLongChar, asBLob, asCLob, asCursor, DataType

SAString

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.