Running a DQL query against a server based Database.
Database contains ~500k documents and is full text indexed.
Code is run as a server agent (On schedule = never, Target = None; then run from console as
tell amgr run "<mydatabase.nsf>" '<myAgentName>'
The agent code is:
Dim sn As New NotesSession
Dim dbThis As NotesDatabase
Dim nQuery As NotesDominoQuery
Dim dcl1 As NotesDocumentCollection
Dim sQuery1 As String
Set dbThis = sn.Currentdatabase
Set nQuery = dbThis.Createdominoquery()
Call nQuery.Setnamedvariable("sCategory", "DEV")
sQuery1 = "tskNumber >= 10000 AND tskNumber < 20000 AND tskCategory in (?sCategory)"
Print "sending query " & sQuery1
Set dcl1 = nQuery.execute(sQuery1, "docset3", True, 2)
Print "number of docs in dcl1 = " & CStr(dcl1.count)
At the server console I see that the agent is started and the line "sending query..." is printed. After that an error message appears at the console:
>> Agent Manager: Agent '<agentName>' error: Domino Query execution error:
Running the same agent with the nQuery execution simplified as
Set dcl1 = nQuery.execute(sQuery1)
The code runs fine, no error occurs, and the result is as expected
the operation that is failing is storing the result set due to the use of substitution (named) variables in the query.
We want to refresh the foundsets in future releases but we can't guess what the substitution value would be