Article
· 22 hr ago 1m read

Cause and solution of <SLMSPAN> error when killing global

InterSystems FAQ rubric

If you try to kill a global that is mapped at the subscript level from the top node, you will get a <SLMSPAN> error and it will not be deleted. This is because the kill command for subscript-level mapped globals cannot be used across mappings.

// Suppose subscript-mapped globals exist in different databases, as shown below:
^TEST(A*~K*) -> database A
^TEST(L*~Z*) -> database B

// Trying to kill from the top level will result in a <SLMSPAN> error.
NAMESPACE>Kill ^TEST
<SLMSPAN> <- This error is output.

To delete only the global in the current namespace (database), use the following:

NAMESPACE>Kill ^["^^."]TEST

Globals mapped at the subscript level must be moved to the database and killed directly.

To switch to the database, use the following:

zn "^^c:\intersystems\iris\mgr\user"
or
set $namespace="^^c:\intersystems\iris\mgr\user"

When importing globals with $System.OBJ.Load, the default behavior is to kill the globals before importing them. As a result, if the target globals are subscript-level mapped, a <SLMSPAN> error occurs. In this case, specify the /mergeglobal flag as the second argument to $system.OBJ.Load as follows to prevent pre-killing:

Set sc = $System.OBJ.Load(path," /mergeglobal",.errors)

enlightened [Reference]
Mapped globals cannot be exported.
How do I compile mapped classes and routines?

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