SetParameter (ODBCResultSet - LotusScript)

Sets the replacement value for the specified parameter.

Defined in

ODBCResultSet

Syntax

status = odbcResultSet . SetParameter( parameter_name$ , value$ )

or

status = odbcResultSet . SetParameter( parameter_index% , value$ )

Parameters

parameter_name$

String. The name of the parameter.

parameter_index%

Integer. The position of the parameter.

value$

String. A value for the parameter. Use Cstr with non-string LotusScript types.

Return value

  • True indicates that the parameter was successfully set.
  • False indicates that the parameter name or index was not found.

Usage

Parameters are set in SQL statements. Unlike ODBC and standard SQL, parameters may appear anywhere in the SQL statement. In LS:DO, a parameter reference is a name enclosed in question marks. Specify the value$ argument as Null to set the parameter as null, if appropriate in the SQL statement.

When you use a parameter surrounded by single quotes, specify the single quotes explicitly. Otherwise, SetParameter does not handle the value correctly. For example, specify the single quotes surrounding the city name as follows:

myquery.SQL = "SELECT * FROM DATA WHERE CITY = ?city? "
...
result1.SetParameter(city,"'Cambridge'")

Events

BeforeSetParameter

AfterSetParameter

Example