SetNamedVariable method (NotesDominoQuery - LotusScript)
Assigns a value to a named substitution variable in a DQL query.
Defined in
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 NotesDatabase db
Dim TheQuery As NotesDominoQuery
Dim doccol As NotesDocumentCollection
Set db = Session.Getdatabase("my.nsf")
Set TheQuery = db.CreateDominoQuery()
TheQuery.Setnamedvariable("lastname", "Stevens")
Set Query$ = firstname != "Annabelle" and lastname = lastname
Set doccol = TheQuery.Execute(Query$)
For more information on substitution variables, see the Domino Query Language documentation.