Question
Kevin McGinn · Sep 9

Usage of the DatabasesByServer method of the Config.Databases class

I am trying to get a list of databases using the DatabaseByServer method but I am only getting an empty string. I have not found any useful examples of the proper usage of this class/method.

I have tried 2 formats. First

set dbList=""

set db=##class(Config.Databases).DatabasesByServer("my-host",.dbList)

I also tried:

set db=##class(Config.Databases).DatabasesByServer("my-host",.dbList,"/cachesys/")

In each case dbList is empty string. I can not figure out what I am missing.

Product version: Caché 2017.1
00
1 0 2 48
Log in or sign up to continue

omit the server name and just use "" for your local server
 

%SYS>set db=##class(Config.Databases).DatabasesByServer("",.dbList)
%SYS>zw
db=1
dbList="DEMO,IRISSYS,CACHE,ECODE,EDATA,ENSLIB,IRISAUDIT,IRISLIB,IRISLOCALDATA,IRISTEMP,USER"
%SYS>

from class docs:

• property Server as %String(MAXLEN=64,MINLEN=0);

Name of the remote server where the DB resides.
If empty, the database is local.
Remote server must already be configured to be entered here.

 so this applies if you have some ECP connected DBs