Skip to main content

%SYS.GlobalQuery

abstract class %SYS.GlobalQuery extends %SYSTEM.Help

Parameters

parameter DOMAIN = %Utility;
Default Localization Domain

Queries

query DirectoryList(Directory As %String, System As %String, Mask As %String, SystemGlobals As %Boolean, Index As %Integer, IgnoreHasData As %Boolean = 0)
Selects Name As %String, ResourceName As %String, Permission As %String, Empty As %String, Keep As %String, Collation As %String, PointerBlock As %String, GrowthBlock As %String, HasData As %Boolean, Journal As %String
Returns a list of the Globals in a database

Parameters:
Directory - the directory file-spec for a database file.
System - ECP database server logical name, as defined in the Application Server list.
Mask - a mask, or comma-separated list of masks, to select globals. Default is "*" for all.
SystemGlobals - boolean flag to include system globals in the results. Default is "0".
Index - Internal use only.
IgnoreHasData - For faster list of Globals set this to 1 and the HasData column will always be FALSE.

Valid masks are as follows:
ABC* - All strings starting with ABC
A:D - All strings between A and D
A:D,Y* - All strings between A and D, and all strings starting with Y
A:D,'C* - All strings between A and D, except those starting with C
query NameSpaceList(NameSpace As %String, Mask As %String, SystemGlobals As %Boolean, ByRef UnavailableDatabases As %String, Index As %Integer, IgnoreHasData As %Boolean = 0, Mapped As %Boolean = 1)
Selects Name As %String, Location As %String, ResourceName As %String, Permission As %String, Empty As %String, Keep As %String, Collation As %String, PointerBlock As %String, GrowthBlock As %String, HasData As %Boolean, Journal As %String, LockLocation As %String, HasSubscripts As %Boolean
Returns a list of the Globals in a namespace (used for GUI display)

Parameters:
NameSpace - a namespace. Default is current namespace.
Mask - a mask, or comma-separated list of masks, to select globals. Default is "*" for all.
SystemGlobals - boolean flag to include system globals in the results. Default is "0".
UnavailableDatabases - a returned local array of any databases not currently accessible, i.e. array(name)=status.
Index - Internal use only.
IgnoreHasData - For faster list of Globals set this to 1 and the HasData column will always be FALSE.
Mapped - Return all mapped global nodes when set to 1, the default value of this parameter is 1.
Valid masks are as follows:
ABC* - All strings starting with ABC
A:D - All strings between A and D
A:D,Y* - All strings between A and D, and all strings starting with Y
A:D,'C* - All strings between A and D, except those starting with C
query NameSpaceListChui(NameSpace As %String, Mask As %String, SystemGlobals As %Boolean, ByRef UnavailableDatabases As %String, Index As %Integer)
Selects Name As %String, Location As %String, ResourceName As %String, Permission As %String, Empty As %String, Keep As %String, Collation As %String, Ptr As %String, Grth As %String, HasData As %Boolean, Jrn As %String, LockLocation As %String
Returns a list of Globals in a namespace (used for terminal display)

Parameters:
NameSpace - a namespace. Default is current namespace.
Mask - a mask, or comma-separated list of masks, to select globals. Default is "*" for all.
SystemGlobals - boolean flag to include system globals in the results. Default is "0".
UnavailableDatabases - a returned local array of any databases not currently accessible, i.e. array(name)=status.
Index - Internal use only.

Valid masks are as follows:
ABC* - All strings starting with ABC
A:D - All strings between A and D
A:D,Y* - All strings between A and D, and all strings starting with Y
A:D,'C* - All strings between A and D, except those starting with C
query NameSpaceSize(Global As %String, FastFlag As %Boolean = 0, SilentSkip As %Boolean = 0)
Selects SubscriptRange As %String, Database As %String, Allocated As %Float, Estimated As %Float
Measures the size of a given global or subnode in the current namespace, iterating over the mappings and measuring data in each. Each row returns the subscript range that was measured, the corresponding database, and either allocated or estimated size in megabytes (MB).

For root globals, this query measures size by each subscript mapping. The sum will equal the total size (or estimate) of the global from the namespace's perspecive.

For subnodes, this query measures the entire subnode once in each mapped database. In typical scenarios, this will still sum to the subnode's overall size from the namespace's perspective.

Note that in certain configurations, a database may contain global data that the namespace doesn't see. This can happen if different namespaces map different parts of the same global to the same database. Subnode queries may measure unseen data and return inflated results in these cases.

Measurements in remote or dismounted databases are unsupported. They either return errors or are quietly skipped if SilentSkip=1.

Parameters:
Global - the name of the global or subnode to measure (for example, "testglobal" or "testglobal(1)"), with or without a prepended carat.
FastFlag - flag to run fast stochastic estimation. If set, fills Estimated column. Otherwise, fills Allocated column. Default is 0 (not set). 1 is recommended for huge globals.
SilentSkip - flag to silently skip unavailable databases and exclude them from results. If 0 (not set), stops and returns an error instead of skipping. Default is 0.
query Size(Directory As %String, System As %String = "", Mask As %String, SystemGlobals As %Boolean, Index As %Integer, FastFlag As %Integer)
Selects Name As %String, Allocated MB As %Float, Used MB As %Float
Returns the size of Globals in a database

Parameters:
Directory - the directory file-spec for a database file.
System - Currently ignored, pass as a null string. Getting the size of a global in an ECP mounted database is not currently supported. You can get the size for these globals directly on the ECP server itself.
Mask - a mask, or comma-separated list of masks, to select globals. Default is "*" for all.
SystemGlobals - boolean flag to include system globals in the results. Default is "0".
Index - Internal use only.
FastFlag - If 1, don't return 'Used' count, only the precise 'Allocated' count. If 2, return estimates for 'Allocated' and 'Used' (fastest option for huge globals).

Valid masks are as follows:
ABC* - All strings starting with ABC
A:D - All strings between A and D
A:D,Y* - All strings between A and D, and all strings starting with Y
A:D,'C* - All strings between A and D, except those starting with C

Inherited Members

Inherited Methods

FeedbackOpens in a new tab