LOTUS CONNECTORS


GetValue method
Example

Retrieves the value of the column referenced by column_id%, and copies the results to the variable field.

Defined in

ODBCResultSet

Syntax

variable = odbcResultSet.GetValue( column_id% [ , variable ] )

or

variable = odbcResultSet.GetValue( column_Name$ [ , variable ] )

or

Call odbcResultSet.GetValue( column_id% , variable )

or

Call odbcResultSet.GetValue( column_Name$ , variable )

Parameters

column_id%


column_Name$
variable
Return value

variable


Usage

Both the return value and the second parameter, if specified, are set to the column value.

The data type of the second parameter determines the data type of the returned data. If you omit this parameter, the data type is as set for this column by the FieldExpectedDataType property; for example, you can set the expected value to return a real value for an integer numeric field. If neither of the preceding are in effect, the data type is the closest to the native data type.

Declare the LotusScript variables used to store date-time values as data type Variant or Double. For date-only values, the data type can also be Variant, Double, or String.

GetValue converts integers outside the range of -32768 to 32768 to the LotusScript Integer data type, or a short integer.

GetValue may terminate abruptly when retrieving data of the SQL_LONGVARCHAR data type from some databases (these fields are often known as "memo" or "rich text" fields); this is a problem with certain ODBC drivers. If possible, try again using a later version of the driver or contact your driver's vendor for assistance.

Null values require special consideration when using GetValue and SetValue. To test for a null value, use the IsValueNull method. If the argument data type is a variant, a null column value is returned as an empty value. Otherwise, the data returned by GetValue is converted to a LotusScript data type. For integers and reals, the returned value is 0; for strings, the returned value is a null (zero length) string; for date-time values, the returned value is "zero" time as defined in LotusScript. For image formats, GetValue treats the data as binary data.

Errors

Field ID is out of range (DBstsINVC)

The result contains no data (DBstsNODA)

Cannot convert data from native to expected or requested datatype (DBstsCNVR)

Events

BeforeGetValue

AfterGetValue

Language cross-reference

@DbColumn(ODBC data source) function in formula language

Example
See Also