Reputation: 31
Sometimes i want to search a character with wildcard, I don't want to search all the global nodes to find specific characters. so i want to know is any wildcard i can use to match specific characters on global nodes. as if i want to find ^G("abc")
in ^G
with ^G("*s*")
Upvotes: 1
Views: 464
Reputation: 2553
There is no way to do this using low level $order/$query functions as @ kazamatzuri correctly said, but you can use %Library.Global:Get class query - first parameter is namespace, and second parameter is pattern string. You can have a documentation on pattern syntax in the class itself or here https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GGBL_managing#GGBL_managing_view
Here is an example using CALL statement - let's assume we want to find all global nodes in ^%SYS global of USER namespace starting with "D":
DEV>d $system.SQL.Shell()
SQL Command Line Shell
----------------------------------------------------
The command prefix is currently set to: <<nothing>>.
Enter <command>, 'q' to quit, '?' for help.
[SQL]DEV>>call %Library.Global_Get('USER','^%SYS("D":"E"')
1. call %Library.Global_Get('USER','^%SYS("D":"E"')
Dumping result #1
Name Value Name Format Value Format Permissions
^%SYS("DBRefByName","CONFIG-ANALYTICS") ^^f:\trakcare\config\db\analytics\ 1
^%SYS("DBRefByName","CONFIG-APPSYS") ^^f:\trakcare\config\db\appsys\ 1 1
^%SYS("DBRefByName","CONFIG-AUDIT0") ^^f:\trakcare\config\db\audit0\ 1 1
^%SYS("DBRefByName","CONFIG-AUDIT1") ^^f:\trakcare\config\db\audit1\ 1 1
^%SYS("DBRefByName","CONFIG-AUDIT2") ^^f:\trakcare\config\db\audit2\ 1 1
Upvotes: 2
Reputation: 433
No.
You'll have to implement that yourself using $ORDER or $QUERY. There are pattern matching and regex utils though.
Cheers!
Upvotes: 0