Goran Stefanovic · Aug 5, 2019

Creating a table in one namespace and inserting into it, but reading and updating it from another namespace

We are developing an interface in Ensemble (v.2018) and would like to have common data visible and updatable from more than one namespace (sort of a lookup, but with more fields).

I can create a table in one namespace and inserting into it, let's say using SQL from the portal. I can also map that table to another namespace. It becomes visible there as a table, but new records inserted in one cannot be seen from the another namespace.

I am reading the documentation, but still no answer. Any help to speed me up?

1 535
Discussion (7)2
Log in or sign up to continue

Suggested approach:
Create a  namespace %ALL which is visible to all other namespaces and map the common class/table into it.
with global, package, routines whatever is related to it. 

See Mapping Data to All Namespaces  link

If you used package mapping you may have forgotten to map the global too.  Examine the class definition to find the global name to map.  If you map the class, but not the global you are getting the code of the class, but the storage would be local.  This allows the sharing of definitions across namespaces without sharing the data.  Add the global mapping to share the data too.

Thanks both Robert and Rich. I tried %ALL already and mapping, but it did not work...

I am missing something, obviously.

Here's what I have done:

- Created %ALL namespace

- Created a table OriginalNamespace.TableName

- Mapped the table in the Global Mappings for %ALL I used the Portal's System > SQL to create the table and to insert/select data from it.

As mentioned, not visible unless in the original namespace.

Isn't it:

"Mapped the table in the Global Mappings for %ALL"

You need both Package mapping and global mappings.

In package mapping you add package containing your table from routine database for original namespace.

In global mapping you add data, index, stream and id globals from global database for original namespace.