Question Bransen Smith · Oct 1, 2024

Help Understanding Global Mappings and Sharing One SQL Table Across Multiple Namespaces

I have the class ConfigUtils.ConfigSettingsTable, which is a persistent object.  I know I need to map packages from the original namespace. In this case, I have mapped ConfigUtils.ConfigSettingsTable from the originating namespace (IRISTST database) across all other namespaces.

With this, I am able to see the table ConfigUtils.InstanceSettings in SQL Explorer in each namespace, but the same data is not shared across environments. For example, in the MAINTENANCE namespace, I can see the table, but I don't see the same information that I see in the table in the original IRISTST namespace.

I am unclear on the global mappings part of this. What globals should I be looking for? I would appreciate any similar examples of mapping a single SQL table across multiple namespaces.

Product version: IRIS 2024.1

Comments

Enrico Parisi · Oct 1, 2024

You need to check the Storage defined in your class, typically automatically generated when the class is first compiled.

For example I have created a ConfigUtils.ConfigSettingsTable class:

Class ConfigUtils.ConfigSettingsTable Extends%Persistent
{

Property Name As%String;

Storage Default
{
<Data name="ConfigSettingsTableDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Name</Value>
</Value>
</Data>
<DataLocation>^ConfigUtils.ConfigSetti1ADBD</DataLocation>
<DefaultData>ConfigSettingsTableDefaultData</DefaultData>
<IdLocation>^ConfigUtils.ConfigSetti1ADBD</IdLocation>
<IndexLocation>^ConfigUtils.ConfigSetti1ADBI</IndexLocation>
<StreamLocation>^ConfigUtils.ConfigSetti1ADBS</StreamLocation>
<Type>%Storage.Persistent</Type>
}

}

In this case the globals used by my class are:

^ConfigUtils.ConfigSetti1ADBD (Data)
^ConfigUtils.ConfigSetti1ADBI (Indices)
^ConfigUtils.ConfigSetti1ADBS (Streams)
 

Instead of the 3 single globals, you can map ^ConfigUtils.ConfigSetti1ADB*

Note that you MUST check the actual global(s) name(s) used by your class.

If your class extends another persistent class, then the storage is defined in the superclass that define the extent (the first persistent class in class hierarchy).

0
Bransen Smith  Oct 1, 2024 to Enrico Parisi

Exactly what I needed. Thank you :)

0
Enrico Parisi · Oct 1, 2024

Note that, if needed, you can map your classes and global for ALL namespaces currently defined and defined in the future, please check Mapping to All Namespaces documentation on how to use %ALL namespace mapping.

0
Scott Roth · Apr 14

I am also trying to map a Database table from one namespace to another. When I enter the following into the %ALL namespace as the global map, when I select from that table in the second namespace I get no results.

0
Robert Cemper  Apr 14 to Scott Roth

Did you mean to map this Global ?
 ^DepartmentMasterData("^E2C8.D9IS.*")  ?????

or just ^E2C8.D9IS.*  ? with all subscripts

0
Scott Roth  Apr 14 to Robert Cemper

The Class name is osuwmc.Epic.Clarity.DepartmentMaster and it is storing data in 

  • Data - ^E2C8.D9IS.1
  • BitmapExtent Index - ^E2C8.D9IS.2
  • IDIndex Index - ^E2C8.D9IS.3
  • IDKey Index - ^E2C8.D9IS.1
  • Indexes - ^E2C8.D9IS.I
  • Stream - ^E2C8.D9IS.S

I am not sure what to put in as the Global Name, would that be E2C8? and then the subscript to be mapped would be D9IS.*?

0
Robert Cemper  Apr 14 to Scott Roth

just E2C8.D9IS.*
to cover all  .1  .2   .3   .S 

and no subscripts

0
Robert Cemper  Apr 14 to Scott Roth

Just to confirm naming in COS 
GlobalName is everything between Caret ^ and left Parenthesis (
GlobalSubscript is everything within left and right Parenthesis  ( ) 

0