Currently working my way through DQL and QRP topics. Tried to get a catch on NamedResults and was wondering for a couple of days why I couldn't get it to work:
I'm working on a simple query like
Set nQuery = myDb.CreateDominoQuery()
sQuery = "taskNumber >= 10000 AND taskNumber <= 20000
Database in question resides on a server, contains 500k documents and is FT indexed.
Running an explain from my client in debug mode is giving me the expected results:
sExplainResult = nQuery.explain(sQuery)
as well as running a simple execute:
Set docCol = nQuery.execute(sQuery)
If however I try to make use of a NamedResult I receive a runtime error:
Set docCol = nQuery.execute(sQuery, "docset1", True, 48)
Error returned is
"Domino Query execution error: invalid arguments"
If however I run the same code as a server agent, or if I run that code in a local replica of the database from my client, then the code works as expected; on the server console I see a message telling me that the Named Result was created/rewritten successfully.
Similar behaviour I see when trying to use Named Variables.
It looks as if we had the same rule here that we have with NotesQueryResultsProcessor: code cannot run in a remote client.
If it is a problem to make this work remotely then it can't be helped (although I think it would makle sense at least for debugging situations...). But then it MUST be documented properly in online AND offline help!