Question
· Oct 12, 2021

ENS ,ENSLIB Tables not able to access from my namespace

Class abc.abcmh [ DdlAllowed ]
{ ClassMethod FetchMsgCount() As %Integer
{
    set msgCount=-1
&sql(SELECT count(ID) INTO :msgCount FROM Ens.MessageHeader)
If SQLCODE=0 Quit msgCount
Quit SQLCODE
}
 

This class method always giving -30 , means Table does not exist.

note: my namespace extends %sys

Product version: IRIS 2020.1
$ZV: IRIS for Windows (x86-64) 2020.1 (Build 215U) Mon Mar 30 2020 20:14:33 EDT
Discussion (6)1
Log in or sign up to continue

you seem to miss this mapping by failed installation

[Map.your namespace>
Global_Ens.SecondaryData*=ENSSECONDARY
Global_EnsDICOM.Dictionary=ENSLIB
Global_EnsEDI.Description=ENS
Global_EnsEDI.Description("X","X12")=ENSLIB
Global_EnsEDI.Schema=ENS
Global_EnsEDI.Schema("HIPAA_4010")=ENSLIB
Global_EnsEDI.Schema("HIPAA_5010")=ENSLIB
Global_EnsEDI.Schema("ISC_00401")=ENSLIB
Global_EnsEDI.Schema("ISC_00405")=ENSLIB
Global_EnsEDI.X12.Description=ENS
Global_EnsEDI.X12.Description("HIPAA_4010")=ENSLIB
Global_EnsEDI.X12.Description("HIPAA_5010")=ENSLIB
Global_EnsEDI.X12.Schema=ENS
Global_EnsEDI.X12.Schema("HIPAA_4010")=ENSLIB
Global_EnsEDI.X12.Schema("HIPAA_5010")=ENSLIB
Global_IRIS.Msg=ENS
Global_IRIS.Msg("Arial,Tahoma,Verdana")=ENSLIB
Global_IRIS.Msg("Confirm")=ENSLIB
Global_IRIS.Msg("EDIDocumentView")=ENSLIB
Global_IRIS.Msg("Ens")=ENSLIB
Global_IRIS.Msg("EnsAlert")=ENSLIB
Global_IRIS.Msg("EnsBPL")=ENSLIB
Global_IRIS.Msg("EnsColumns")=ENSLIB
Global_IRIS.Msg("EnsDICOM")=ENSLIB
Global_IRIS.Msg("EnsEDI")=ENSLIB
Global_IRIS.Msg("EnsEDIEDIFACT")=ENSLIB
Global_IRIS.Msg("EnsEDIHL7")=ENSLIB
Global_IRIS.Msg("EnsEDISEF")=ENSLIB
Global_IRIS.Msg("EnsEDIX12")=ENSLIB
Global_IRIS.Msg("EnsEnt")=ENSLIB
Global_IRIS.Msg("EnsLDAP")=ENSLIB
Global_IRIS.Msg("EnsMQTT")=ENSLIB
Global_IRIS.Msg("EnsPushNotifications")=ENSLIB
Global_IRIS.Msg("EnsRecordMap")=ENSLIB
Global_IRIS.Msg("EnsSAP")=ENSLIB
Global_IRIS.Msg("EnsSR")=ENSLIB
Global_IRIS.Msg("EnsSearchTable")=ENSLIB
Global_IRIS.Msg("EnsWf")=ENSLIB
Global_IRIS.Msg("EnsXPATH")=ENSLIB
Global_IRIS.Msg("EnsebXML")=ENSLIB
Global_IRIS.Msg("Ensemble")=ENSLIB
Global_IRIS.Msg("ITK")=ENSLIB
Global_IRIS.Msg("RuleEditor")=ENSLIB
Global_IRIS.Msg("Workflow")=ENSLIB
Global_IRIS.Msg("tahoma,verdana")=ENSLIB
Global_IRIS.MsgNames=ENS
Global_IRIS.MsgNames("Arial,Tahoma,Verdana")=ENSLIB
Global_IRIS.MsgNames("Confirm")=ENSLIB
Global_IRIS.MsgNames("EDIDocumentView")=ENSLIB
Global_IRIS.MsgNames("Ens")=ENSLIB
Global_IRIS.MsgNames("EnsAlert")=ENSLIB
Global_IRIS.MsgNames("EnsBPL")=ENSLIB
Global_IRIS.MsgNames("EnsColumns")=ENSLIB
Global_IRIS.MsgNames("EnsDICOM")=ENSLIB
Global_IRIS.MsgNames("EnsEDI")=ENSLIB
Global_IRIS.MsgNames("EnsEDIEDIFACT")=ENSLIB
Global_IRIS.MsgNames("EnsEDIHL7")=ENSLIB
Global_IRIS.MsgNames("EnsEDISEF")=ENSLIB
Global_IRIS.MsgNames("EnsEDIX12")=ENSLIB
Global_IRIS.MsgNames("EnsEnt")=ENSLIB
Global_IRIS.MsgNames("EnsLDAP")=ENSLIB
Global_IRIS.MsgNames("EnsMQTT")=ENSLIB
Global_IRIS.MsgNames("EnsPushNotifications")=ENSLIB
Global_IRIS.MsgNames("EnsRecordMap")=ENSLIB
Global_IRIS.MsgNames("EnsSAP")=ENSLIB
Global_IRIS.MsgNames("EnsSR")=ENSLIB
Global_IRIS.MsgNames("EnsSearchTable")=ENSLIB
Global_IRIS.MsgNames("EnsWf")=ENSLIB
Global_IRIS.MsgNames("EnsXPATH")=ENSLIB
Global_IRIS.MsgNames("EnsebXML")=ENSLIB
Global_IRIS.MsgNames("Ensemble")=ENSLIB
Global_IRIS.MsgNames("ITK")=ENSLIB
Global_IRIS.MsgNames("RuleEditor")=ENSLIB
Global_IRIS.MsgNames("Workflow")=ENSLIB
Global_IRIS.MsgNames("tahoma,verdana")=ENSLIB
Global_IRIS.Temp.EnsHostTotals=IRISTEMP
Global_IRIS.Temp.EnsPortal*=IRISTEMP
Global_IRIS.Temp.EnsPublic*=IRISTEMP
Global_IRIS.Temp.Ens*=ENSENSTEMP
Routine_Ens*=ENSLIB
Package_CSPX.Dashboard=ENSLIB
Package_Ens=ENSLIB
Package_EnsLib=ENSLIB
Package_EnsPortal=ENSLIB

and eventually also these databases

ENSENSTEMP=C:\InterSystems\IRIS\mgr\ENS\ensenstemp\
ENSLIB=C:\InterSystems\IRIS\mgr\enslib\
ENSSECONDARY=C:\InterSystems\IRIS\mgr\ENS\enssecondary\

Thanks Rabert for quick reply.

when i created mynamespace in management portal, below log created.

Enabling namespace 'TEST' for Interoperability:
* This instance is not in a mirror
* Mappings
- Class:
 + Adding class mapping Ens -> ENSLIB
 + Adding class mapping EnsLib -> ENSLIB
 + Adding class mapping EnsPortal -> ENSLIB
 + Adding class mapping CSPX.Dashboard -> ENSLIB
- Routine:
 + Adding routine mapping Ens* -> ENSLIB
- Global:
 + Checking/fixing global directory settings for existing global ^EnsDICOM.Dictionary
 + Checking/fixing global directory settings for existing global ^EnsEDI.ASTM.Description
 + Checking/fixing global directory settings for existing global ^EnsEDI.ASTM.Schema
 + Checking/fixing global directory settings for existing global ^EnsEDI.Description
 + Checking/fixing global directory settings for existing global ^EnsEDI.Schema
 + Checking/fixing global directory settings for existing global ^EnsEDI.X12.Description
 + Checking/fixing global directory settings for existing global ^EnsEDI.X12.Schema
 + Checking/fixing global directory settings for existing global ^EnsHL7.Description
 + Checking/fixing global directory settings for existing global ^EnsHL7.Schema
 + Checking/fixing global directory settings for existing global ^IRIS.Msg
 + Checking/fixing global directory settings for existing global ^IRIS.MsgNames
 + Adding global mapping ^EnsDICOM.Dictionary -> ENSLIB
 + Adding global mapping ^EnsEDI.ASTM.Description("E1394") -> ENSLIB
 + Adding global mapping ^EnsEDI.ASTM.Schema("E1394") -> ENSLIB
 + Adding global mapping ^EnsEDI.Description("X","X12") -> ENSLIB
 + Adding global mapping ^EnsEDI.Schema("HIPAA_4010") -> ENSLIB
 + Adding global mapping ^EnsEDI.Schema("HIPAA_5010") -> ENSLIB
 + Adding global mapping ^EnsEDI.Schema("ISC_00401") -> ENSLIB
 + Adding global mapping ^EnsEDI.Schema("ISC_00405") -> ENSLIB
 + Adding global mapping ^EnsEDI.X12.Description("HIPAA_4010") -> ENSLIB
 + Adding global mapping ^EnsEDI.X12.Description("HIPAA_5010") -> ENSLIB
 + Adding global mapping ^EnsEDI.X12.Schema("HIPAA_4010") -> ENSLIB
 + Adding global mapping ^EnsEDI.X12.Schema("HIPAA_5010") -> ENSLIB
 + Adding global mapping ^EnsHL7.Description("2.3.1") -> ENSLIB
 + Adding global mapping ^EnsHL7.Description("2.5.1") -> ENSLIB
 + Adding global mapping ^EnsHL7.Description("2.7.1") -> ENSLIB
 + Adding global mapping ^EnsHL7.Description("2.8.1") -> ENSLIB
 + Adding global mapping ^EnsHL7.Description("2.8.2") -> ENSLIB
 + Adding global mapping ^EnsHL7.Description("ITK") -> ENSLIB
 + Adding global mapping ^EnsHL7.Description(2.1) -> ENSLIB
 + Adding global mapping ^EnsHL7.Description(2.2) -> ENSLIB
 + Adding global mapping ^EnsHL7.Description(2.3) -> ENSLIB
 + Adding global mapping ^EnsHL7.Description(2.4) -> ENSLIB
 + Adding global mapping ^EnsHL7.Description(2.5) -> ENSLIB
 + Adding global mapping ^EnsHL7.Description(2.6) -> ENSLIB
 + Adding global mapping ^EnsHL7.Description(2.7) -> ENSLIB
 + Adding global mapping ^EnsHL7.Description(2.8) -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema("2.3.1") -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema("2.5.1") -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema("2.7.1") -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema("2.8.1") -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema("2.8.2") -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema("ITK") -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema(2.1) -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema(2.2) -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema(2.3) -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema(2.4) -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema(2.5) -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema(2.6) -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema(2.7) -> ENSLIB
 + Adding global mapping ^EnsHL7.Schema(2.8) -> ENSLIB
 + Adding global mapping ^IRIS.Msg("Arial,Tahoma,Verdana") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("Confirm") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EDIDocumentView") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("Ens") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsAlert") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsBPL") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsColumns") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsDICOM") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsEDI") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsEDIEDIFACT") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsEDIHL7") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsEDISEF") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsEDIX12") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsEnt") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsLDAP") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsMQTT") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsPushNotifications") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsRecordMap") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsSAP") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsSR") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsSearchTable") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsWf") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsXPATH") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("EnsebXML") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("Ensemble") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("ITK") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("RuleEditor") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("Workflow") -> ENSLIB
 + Adding global mapping ^IRIS.Msg("tahoma,verdana") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("Arial,Tahoma,Verdana") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("Confirm") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EDIDocumentView") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("Ens") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsAlert") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsBPL") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsColumns") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsDICOM") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsEDI") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsEDIEDIFACT") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsEDIHL7") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsEDISEF") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsEDIX12") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsEnt") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsLDAP") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsMQTT") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsPushNotifications") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsRecordMap") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsSAP") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsSR") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsSearchTable") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsWf") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsXPATH") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("EnsebXML") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("Ensemble") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("ITK") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("RuleEditor") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("Workflow") -> ENSLIB
 + Adding global mapping ^IRIS.MsgNames("tahoma,verdana") -> ENSLIB
- Updating CPF
- Moving changes to active configuration
 - Loading new mappings for namespace 'TEST'
* Validating Installation in 'TEST'
- Checking class 'Ens.Director' ...
- Checking class 'Ens.MessageBody' ...
- Checking class 'Ens.StudioManager' ...
- Checking class 'EnsLib.HL7.Message' ...
* Mappings:
 + Adding class mapping HS -> HSLIB
 + Adding class mapping HSMOD -> HSLIB
- Routine:
 + Adding routine mapping HS.* -> HSLIB
 + Adding routine mapping HSMOD.* -> HSLIB
- Updating CPF
- Moving changes to active configuration
 - Loading new mappings for namespace 'TEST'
* Complete!
- Updating CPF
- Moving changes to active configuration
 - Loading new mappings for namespace 'TEST'
HS.Util.Installer.Foundation:Install User '_SYSTEM' has %Admin_Manage:USE privilege
HS.Util.Installer.Foundation:Install tComponent Foundation = TEST
HS.HC.Util.Installer:EnableEnsemble Created Ensemble Mappings
HS.HC.Util.Installer:EnableEnsemble Configuration Loaded
HS.HC.Util.Installer:EnableEnsemble Compiling Ensemble DeepSee Dashboard
HS.HC.Util.Installer:EnableEnsemble Ensemble Enabled
HS.Util.Installer.Foundation:SecureInstall Added Package mappings HS,HSMOD,SchemaMap
HS.Util.Installer.Foundation:SecureInstall Added include mappings HSMOD.*,SchemaMap*
HS.Util.Installer.Foundation:Install Created Portal CSP app
HS.Util.Installer.Foundation:CreateProduction Compiled template TESTPKG.FoundationProduction
HS.Util.Installer.Foundation:AdditionalSetup Set Credential HS_Services
HS.Util.Installer.Foundation:SecureInstall Recompiled XML extension classes
HS.Util.Installer.Foundation:SecureInstall Install TEST done at 2021-10-12 22:12:14
* Creating Interoperability Management Portal
- Not copying legacy CSP pages for portal application
- Configuring portal: /csp/healthshare/test [TEST] using C:\InterSystems\HealthConnect\CSP\healthshare\test
- Updating CSP Application: /csp/healthshare/test
   Type                 = [2]
   CookiePath           = [/csp/healthshare/]
   LockCSPName          = [1]
   NameSpace            = [TEST]
   CSPZENEnabled        = [1]
   GroupById            = [%ISCMgtPortal]
   ServeFiles           = [2]
   UseCookies           = [2]
- Removing legacy CSP pages and files from directory 'C:\InterSystems\HealthConnect\CSP\healthshare\test\'
- Not compiling portal '/csp/healthshare/test/' in TEST as no CSP files were copied
* Adding explicit SQL privileges to Interoperability Roles
- Adding SQL privileges for role '%EnsRole_Administrator'
- Adding SQL privileges for role '%EnsRole_AlertOperator'
- Adding SQL privileges for role '%EnsRole_Developer'
- Adding SQL privileges for role '%EnsRole_Monitor'
- Adding SQL privileges for role '%EnsRole_Operator'
- Adding SQL privileges for role '%EnsRole_RegistryManager'
- Adding SQL privileges for role '%EnsRole_RegistrySelect'
- Adding SQL privileges for role '%EnsRole_RulesDeveloper'
- Adding SQL privileges for role '%EnsRole_WebDeveloper'
* Adding Interoperability SearchTables
- Validating all SearchTable metadata
 - Regenerating metadata for EnsLib.EDI.ASTM.SearchTable
 - Regenerating metadata for EnsLib.EDI.EDIFACT.SearchTable
 - Regenerating metadata for EnsLib.EDI.X12.SearchTable
 - Regenerating metadata for EnsLib.EDI.XML.SearchTable
 - Regenerating metadata for EnsLib.HL7.SearchTable
 - Regenerating metadata for EnsLib.XML.SearchTable
* Checking for existing named message searches
- No saved message searches found in namespace 'TEST'; no conversion necessary.
* Checking DocClassMap
 + DocClassMap already present in namespace 'TEST'; no upgrade steps needed
* Checking for incorrect Timestamp indices
- No UTC index globals need to be repaired.
* Legacy CSP Portal not installed, so no legacy CSP pages recompiled.
* Generating meta data for Interoperability Analytics items
Replacing: Ens/Analytics/ActivityVolumeAndDuration.dashboard

Imported 1 item.
Encountered 0 errors during import.

* Setting new namespace flags
- Ens.Config SyncCommit already exists
Update Complete.
Done

Good Morning,
Now the case seems rather clear to me:

  • in a fresh image of IRIS, the namespace USER is preconfigured for Interoperability/Ensemble and your Copy from should be USER
  • differently in a fresh installed HS image, it is the namespace HSSYS that is preconfigured for Interoperability/Ensemble and your Copy from should be HSSYS
  • namespace %SYS was and is  NEVER configured to work  in Interoperability/Ensemble
  • similar is IRISSYS using as your working database a bad misconfiguration with unpredictable conflicts and consequences  

On top of Robert's answer, I would add - why are you copying from another namespace at all? If you just need the standard interoperability mappings, those get generated from the "enable namespace for Interoperability productions" checkbox.

You can't run 2 productions (even if you assign 2 namespaces) from the same databases simultaneously, so I would probably avoid "copy from" in general, particularly because you are trying to use EnsLib code.

There are probably specific cases where you might want to copy a namespace from another one, but I'd be cautious and make sure that copying is what you actually want.

edit: I am unsure whether using "copy from" on HSSYS is a good idea. Personally, I haven't done that, but I would be concerned that you might have similar issues to copying from %SYS, as HSSYS is a shipped database.