You could just pass this arguments in Execute method, something like this
new $namespace
set $namespace="%sys"
Set tRS = ##class(%ResultSet).%New("%SYS.Journal.File:Search")
Set tSC = tRS.Execute("test", "/opt/cache/mgr/journal/20160507.001")
if $$$ISERR(tSC) {
do $system.OBJ.DisplayError(tSC)
}
do tRS.%Display()this code will return all offset's which contains text - 'test'
You must remember that this query should be executed only in %SYS namespace.
Usually we could use some another modern ways, which allow us to call queries.
set statement=##class(%SQL.Statement).%New()
set tSC=statement.%PrepareClassQuery("%SYS.Journal.File","Search")
if $$$ISERR(tSC) {
do $system.OBJ.DisplayError(tSC)
}
Set tRS = statement.%Execute("test", "/opt/cache/mgr/journal/20160507.001")or even much shorter
set tRS=##class(%SYS.Journal.File).SearchFunc("test", "/opt/cache/mgr/journal/20160507.001")
do tRS.%Display()But unfortunately such code snippets does not work in case when Query does not contain any parameters in his original declaration.
- Log in to post comments
