Variable as a property value
When creating the db using the Properties array, if I use a literal like "/iris/db/<instance name>/<directoryname>" it's created in the correct directory.
set Properties("Directory")="/iris/db/InstanceName/DirectoryName"
but when it's executed with a variable, as in the example below, it gets created in /iris/sys/<instance name>/mgr/
set directoryPath="/iris/db/InstanceName/DirectoryName"
set Properties("Directory")=directoryPath
Is there any reason string literals work and variables do not?
Comments
what is the method and the namespace you use to create the db ??
DB creation:
set Status=##Class(Config.Databases).Create(Name,.Properties)
and namespace creation:
set Status=##Class(Config.Namespaces).Create(Name,.Properties)
The variable can't be the problem
BUT the typical default structure is /iris/sys/<instance name>/mgr/<namespace>
If so why then pick default config rather than what is passed as a variable? Here is another case when it will fall back to the default one instead using what is set as a variable:
set Name=$SYSTEM.Util.GetEnviron("RESOURCE_DB_NAME")set Path=$SYSTEM.Util.GetEnviron("RESOURCE_DB_PATH")set Properties("Directory")=Pathset Status=##Class(Config.Databases).Create(Name,.Properties)there is no public code available to examine.
WRC has access to internals