Playing around with DQL, and especially with NamedVariables.
The NotesDominoQuery class at the moment has 2 methods dealing with named variables:
DQL.setNamedVariable("name", "value")
DQL.resetNamedVariables()
The more I try to use that concept the more I need to know which variable names have been defined so far. That in my opinion calls for a getter method like
Variant names = DQL.getNamedVariables()
Result could also be JSON, text list, or whatever you feel appropriate, then not only containing the names but also the values.
And following up on this this calls out to methods to remove individual names:
DQL.removeNamedVariable("name")
In regards to documentation: information on NamedVariables is extremely basic (trying to be polite). Up to now I want these questions answered:
is it correct to assume that NamedVariables are stored in the design catalog?
is it valid only for a single database?
is it replicated?
what is the life span of a NamedVariable?
are there any known limitations in regards to sizes, data types, number of characters, whatever
More questions are likely to come up as I continue to work with that stuff.
Keep up the good work!
In case direct feedback is needed: lothar.mueller@edcom.de
The community always provides a lot of hands-on documentation and examples. I don't think variable processing in DQL is particularly mysterious. All other database systems have used the construct for years, including the scope.
John, thanks for answering.
You write that the vaiables' scope is that of the DomQuery object. So, in other words, they are created with my code (probably an agent), held in memory as long as the code runs, and then they are thrown away. Right? Probably makes sense that way though I kind of expected them to be persistent some way. Hence my questions.
As I wrote back in May: documentation is extremely sparse on most new topics brought into Notes and Domino by HCL, so all we can do is guess - and ask.
Thanks for your support.
A lot there.
It's a toss up of who is responsible for knowing the set of named variables assigned to a (Notes)DominoQuery object. We certainly have the list, but so do you. Not sure it makes sense to spend cycles on that from our perspective .. MUCH bigger fish to fry.
Named variables have the scope of the (Notes)DominoQuery object, as they do in all database systems everywhere. They do not persist past its destruction. It sounds like you may want them to, and that would have to be projectified in Jira and undergo priority review.