Question Adam Raszkiewicz · Aug 28, 2023

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

Robert Cemper · Aug 28, 2023

what is the method and the namespace you use to create the db ??

0
Adam Raszkiewicz  Aug 28, 2023 to Robert Cemper

DB creation:

set Status=##Class(Config.Databases).Create(Name,.Properties)

and namespace creation:

set Status=##Class(Config.Namespaces).Create(Name,.Properties)

0
Robert Cemper · Aug 29, 2023

The variable can't be the problem
BUT the typical default structure is /iris/sys/<instance name>/mgr/<namespace>

0
Adam Raszkiewicz  Aug 29, 2023 to Robert Cemper

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)
0
Robert Cemper  Aug 29, 2023 to Adam Raszkiewicz

there is no public code available to examine.
WRC has access to internals

0