Platforms to show: All Mac Windows Linux Cross-Platform

Back to SQLValueReadMBS class.

SQLValueReadMBS.asBLob as SQLStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as BLob (SQLString) data.

If the value of current object is NULL, asBLob method returns an empty string. Use isNull method to make sure if the value is NULL or not.

If the value's type of current object is string (kDataTypeString), bytes (kDataTypeBytes), long binary (kDataTypeLongBinary), long character (kDataTypeLongChar), BLob (kDataTypeBLob) or CLob (kDataTypeCLob), asBLob method returns the object's value as SQLString object.

If the value's type of current object is bool (kDataTypeBool), short (kDataTypeShort), long (kDataTypeLong), double (kDataTypeDouble), numeric (kDataTypeNumeric), date-time (kDataTypeDateTime) or cursor (kDataTypeCursor), the result is undefined and debug version asserts.

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

Some examples using this method:

SQLValueReadMBS.asBLobMemory as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 16.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as BLob data in a memoryblock.

SQLValueReadMBS.asBLobString as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 16.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as BLob data in a string.

SQLValueReadMBS.asBytes as SQLStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as binary string data (SQLString).

If the value of current object is NULL, asBytes method returns an empty string. Use isNull method to make sure if the value is NULL or not.

If the value's type of current object is string (kDataTypeString), bytes (kDataTypeBytes), long binary (kDataTypeLongBinary), long character (kDataTypeLongChar), BLob (kDataTypeBLob) or CLob (kDataTypeCLob), asBytes method returns the object's value as SQLString object.

If the value's type of current object is bool (kDataTypeBool), short (kDataTypeShort), long (kDataTypeLong), double (kDataTypeDouble), numeric (kDataTypeNumeric) or date-time (kDataTypeDateTime), asBytes method returns a block of data with size sizeof(value's type) as SQLString object.

If the value's type of current object is cursor (kDataTypeCursor), the result is undefined and debug version asserts.

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

SQLValueReadMBS.asCLob as SQLStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as CLob (SQLString) data.

If the value of current object is NULL, asCLob method returns an empty string. Use isNull method to make sure if the value is NULL or not.

If the value's type of current object is string (kDataTypeString), bytes (kDataTypeBytes), long binary (kDataTypeLongBinary), long character (kDataTypeLongChar), BLob (kDataTypeBLob) or CLob (kDataTypeCLob), asCLob method returns the object's value as SQLString object.

If the value's type of current object is bool (kDataTypeBool), short (kDataTypeShort), long (kDataTypeLong), double (kDataTypeDouble), numeric(kDataTypeNumeric), date-time (kDataTypeDateTime) or cursor (kDataTypeCursor), the result is undefined and debug version asserts.

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

SQLValueReadMBS.asDate as Date

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Returns the value as date.
Example
dim cmd as SQLCommandMBS // your command object
dim d as date = cmd.Field("mydate").asDate // read date value

If the value of current object is NULL, asDate method returns an empty date object. Use isNull method to make sure if the value is NULL or not.

If the value's type of current object is kDataTypeDateTime, asDate method returns date object.

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

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

SQLValueReadMBS.asDateTime as SQLDateTimeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as SQLDateTimeMBS object.

If the value of current object is NULL, asDateTime method returns an empty SQLDateTime object. Use isNull method to make sure if the value is NULL or not.

If the value's type of current object is kDataTypeDateTime, asDateTime method returns SQLDateTime object.

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

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

SQLValueReadMBS.asDateTimeValue as DateTime

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 20.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as date.

If the value of current object is NULL, asDate method returns an empty date object. Use isNull method to make sure if the value is NULL or not.

If the value's type of current object is kDataTypeDateTime, asDate method returns date object.

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

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

SQLValueReadMBS.asInterval as SQLIntervalMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as interval (SQLIntervalMBS).

SQLValueReadMBS.asLongBinary as SQLStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as long binary (SQLString) data.

If the value of current object is NULL, asLongBinary method returns an empty string. Use isNull method to make sure if the value is NULL or not.

If the value's type of current object is string (kDataTypeString), bytes (kDataTypeBytes), long binary (kDataTypeLongBinary), long character (kDataTypeLongChar), BLob (kDataTypeBLob) or CLob (kDataTypeCLob), asLongBinary method returns the object's value as SQLString object.

If the value's type of current object is bool (kDataTypeBool), short (kDataTypeShort), long (kDataTypeLong), double (kDataTypeDouble), numeric (kDataTypeNumeric), date-time (kDataTypeDateTime) or cursor (kDataTypeCursor), the result is undefined and debug version asserts.

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

SQLValueReadMBS.asLongChar as SQLStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as long character (SQLString) data.

If the value of current object is NULL, asLongChar method returns an empty string. Use isNull method to make sure if the value is NULL or not.

If the value's type of current object is string (kDataTypeString), bytes (kDataTypeBytes), long binary (kDataTypeLongBinary), long character (kDataTypeLongChar), BLob (kDataTypeBLob) or CLob (kDataTypeCLob), asLongChar method returns the object's value as SQLString object.

If the value's type of current object is bool (kDataTypeBool), short (kDataTypeShort), long (kDataTypeLong), double (kDataTypeDouble), numeric (kDataTypeNumeric), date-time (kDataTypeDateTime) or cursor (kDataTypeCursor), the result is undefined and debug version asserts.

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

SQLValueReadMBS.asNumeric as SQLNumericMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value as SQLNumeric data.

If the value of current object is NULL, asNumeric method returns 0. Use isNull method to make sure if the value is NULL or not.

If the value's type of current object is exact numeric value (kDataTypeNumeric), asNumeric method returns the original value with no conversion.

If the value's type of current object is bool (kDataTypeBool), short (kDataTypeShort), double (kDataTypeDouble) or long (kDataTypeLong), asNumeric method converts it to SQLNumeric .

If the value's type of current object is string (kDataTypeString), asNumeric method tries to convert it from SQLChar* value. If the conversion is possible and correct, asNumeric converts to SQLNumeric from SQLChar* value. If conversion is incorrect asNumeric 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 DataType method to get the value's type of SQLValueRead object.

SQLValueReadMBS.asString as SQLStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
returns the value as string (SQLString) data.

If the value of current object is NULL, asString method returns an empty string. Use isNull method to make sure if the value is NULL or not.

If the value's type of current object is bool (kDataTypeBool), asString method returns "true" or "false" string (SQLString object).

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

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

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

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

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

If the value's type of current object is string (kDataTypeString, kDataTypeLongChar, kDataTypeCLob), asString method returns the original object's value as SQLString object.

If the value's type of current object is binary (kDataTypeBytes, kDataTypeLongBinary, kDataTypeBLob), asString method converts it to hexadecimal string ( SQLString object).

If the value's type of current object is cursor (kDataTypeCursor), the result is undefined and debug version asserts.

Use DataType method to get the value's type of SQLValueRead object.
For numbers, this may give english decimal separator. For getting localized one, please use AsDoubleValue and use cstr() function.

SQLValueReadMBS.Constructor(DataType as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new empty value object for the given data type.

See also:

SQLValueReadMBS.Constructor(value as SQLValueReadMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new value object by copying the given one.

See also:

The items on this page are in the following plugins: MBS SQL Plugin.


The biggest plugin in space...