User bio
Developer on the Language Interoperability Team at InterSystems.
Member since Nov 7, 2015
Posts:
Replies:
Basically the same as Enrico's:
LATEST:USER>set result = $system.SQL.Execute("select * from %SYS.Namespace_List()")
LATEST:USER>do result.%Display()
Nsp Status Remote
%SYS 1 0
B360 1 0
USER 1 0
3 Rows(s) Affected
The PackageDefinition class contains only packages where we need to keep metadata about a package. Most packages do not have any extra metadata.
The SQL solution is the correct solution IMO. If I were a developer on the Object team I would advocate for a method in $system.OBJ - PackageExists(<package_name>) perhaps. :)
Open Exchange applications:
Certifications & Credly badges:
Dan has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Following:
set stream = ##class(%Stream.FileCharacter).%OpenId("/Users/.../data/continents-en.json")
Did you know that you can just open a file as a stream?
And for iterating - this has been in the product for a while now. This is the code for my :pp alias.
ClassMethod pp(set As %AbstractSet, offset As %Integer = 0) { #define QUOTE(%val) $zu(144,1,%val) try { set isLabeled = set."_isLabeled"() if (isLabeled) { write "{" set close = "}" } else { write "[" set close = "]" } set it = set.iterator() while it.hasNext() { set next = it.next() if $isobject(next.value) { write !,?(offset+2) write:isLabeled $$$QUOTE(next.key),": " do ..pp(next.value, offset + 2) } else { write !,?(offset+2),$select(isLabeled:$$$QUOTE(next.key)_": ",1:""),$$$QUOTE(next.value) } if it.hasNext() { write "," } } write !,?offset,close } catch exc { write !,"Exception caught: ",exc.AsSQLMessage() } return }
This is in %ASQ.SetUtils. My alias, pp - pretty print, is this:
pp do ##class(%ASQ.SetUtils).pp($*)