SetNamedVariable method (NotesDominoQuery - LotusScript)

Assigns a value to a named substitution variable in a DQL query.

Defined in

NotesDominoQuery

Syntax

NotesDominoQuery.Setnamedvariable( variablename$, value )

Parameters

VariableName$

String. The name of a substitution variable specified in a DQL query, after the question mark. So "date_of_birth? is seen as ?date_of_birth in DQL syntax.

Value

Variant. Can be String, number or DateTime object.

Return value

None

Example

Dim Query As String
Dim lastname As String
Dim db As NotesDatabase
Dim TheQuery As NotesDominoQuery
Dim doccol As NotesDocumentCollection
Dim Session As New NotesSession
Set db = Session.Getdatabase("", "my.nsf")
Set TheQuery = db.CreateDominoQuery()
REM Note - substitution variable names are case sensitive.  
REM Maximum subsitution variable name length is 16 bytes
Call TheQuery.Setnamedvariable("lastname", "Stevens")
Query = "firstname != 'Annabelle' and lastname = ?lastname"
Set doccol = TheQuery.Execute(Query$)

For more information on substitution variables, see the section Domino Query Language.

Language cross-reference

setNamedVariable method (DominoQuery - Java)