Question
· May 16, 2016

INSERT into a SQL table in another namespace

We have a routine in one namespace.

We have a Cache SQL table in a different namespace.

What is the syntax for inserting into this table from the routine in the other namespace?

Can this be done without using ZN?

Thanks.

Discussion (5)0
Log in or sign up to continue

You could map the package containing the class related to that table using a package mapping, and the globals containing the table's data using global mappings.

You can see which globals the class uses in its storage definition - since the entire package is mapped, it might make sense to add a global mapping with the package name and a wildcard (*).

After taking those steps, you can insert to the table the way you usually would, without any special syntax or using zn/set $namespace.