Question
· Sep 25, 2017

Getting SQL Gateway Connection Details - ODBC

I was hoping someone might be able to help me. 

I am after some code i can run (preferably in terminal) to return details of an SQL Gateway Connection (ODBC).

Scenario is a forgotten password for a server that needs its connection details replicating on another production.

I know this can be done with Credentials by simply querying the 'Ens.Config.Credentials' class however i cannot seem to find the equivalent.

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

ENSDEMO>d $system.SQL.Shell()
SQL Command Line Shell
----------------------------------------------------
 
The command prefix is currently set to: <<nothing>>.
Enter q to quit, ? for help.
ENSDEMO>>select * from Ens_Config.Credentials
1.      select * from Ens_Config.Credentials
 
ID      BusinessPartner PasswordObject  Password        SystemName      Username
 
.... Rows(s) Affected

Thanks for your response Robert however this is not the information I am trying to extract. 

The 'Ens.Config.Credentials' table was simply an example in my request, sorry if i confused issues.

I am after information stored in the Manage Portal under

System > Configuration > SQL Gateway Connectons

These details are not kept in the 'Ens.Config.Credentials' table.

many thanks

Jonathan

By setting up a gateway connection and then looking at the journal records I tracked down this global subtree:

%SYS>d ^%G
 
For help on global specifications DO HELP^%G
Global ^%SYS("sql","ODBCCONNECTION"
^%SYS("sql","ODBCCONNECTION","DATA")=1
^%SYS("sql","ODBCCONNECTION","DATA",1)=$lb("","ENS171 Samples","YJM","_system","HnBuSSuEERERntcVPGsUMQ==",0,0,"","","","",0,"",0,0,1,0,1,0,"",0)
^%SYS("sql","ODBCCONNECTION","INDEX","NameIndex"," YJM",1)=""
 
Global ^
 
%SYS>

The password (see yellow highlight) isn't stored in plaintext.