persistent class %Library.SQLConnection
extends %Persistent, %XML.Adaptor
SQL Table Name: sys_SQLConnection
property DSN
as %String(CAPTION="DSN",MAXLEN=256);
property Name
as %String(CAPTION="Connection Name") [ SqlFieldName = Connection_Name,Required ];
property OnConnectStatement
as %String(CAPTION="Statement to execute upon connection",MAXLEN=4096);
Statement to execute on remote system immediately after connection.
This is only for a Gateway conenction through %Library.GTWConnection.Connect() method.
An example usage of this would be to set a session parameter on an Oracle connection:
ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF6'
property ReverseOJ
as %Boolean(CAPTION="Legacy Sybase outer join syntax");
property URL
as %String(CAPTION="URL",MAXLEN=4096);
property Usr
as %String(CAPTION="User");
property bUnicodeStream
as %Boolean(CAPTION="Supports Unicode Streams") [ InitialExpression = 1 ];
property bindTSasString
as %Boolean(CAPTION="Bind TIMESTAMP parameters as VARCHAR") [ InitialExpression = 0 ];
Bind TIMESTAMP type parmaters as VARCHAR.
When binding parameter values via the GateWay, some remote systems consider TIMESTAMP as a special structure that does not
match the the %TimeStamp datatype format of YYYY-MM-DD HH24:MI;SS[.ssssss].
Setting this property to 1 will bind TIMESTAMP parameters as VARCHARs instead of TIMESTAMP.
You might need this setting when binding TIMESTAMP parameters to Oracle, depending on the Oracle driver used.
property classpath
as %Library.String(CAPTION="Class Path",MAXLEN=4096);
property driver
as %String(CAPTION="driver",MAXLEN=256);
property isJDBC
as %Boolean(CAPTION="Is JDBC connection");
property needlongdatalen
as %Boolean(CAPTION="Needs long data length");
property noconcat
as %Boolean(CAPTION="Do not generate {fn concat()}");
property nodefq
as %Boolean(CAPTION="Do not use delimited identifiers by default");
property nofnconv
as %Boolean(CAPTION="Do not generate {fn conv ...} by default");
property nvl
as %Boolean(CAPTION="Use NVL() instead of IFNULL()");
property properties
as %Library.String(CAPTION="Properties",MAXLEN=256);
property pwd
as %CSP.Util.Passwd(CAPTION="Password",MAXLEN="");
property useCAST
as %Boolean(CAPTION="Use CAST as VARCHAR");
property useCASTCHAR
as %Boolean(CAPTION="Use CAST as CHAR");
property useCOALESCE
as %Boolean(CAPTION="Use COALESCE") [ InitialExpression = 1 ];
property xadriver
as %String(CAPTION="driver",MAXLEN=256);
query ByConnection()
Selects
Connection_Name, DSN, User, ID
SQL Query
:
SELECT Connection_Name, DSN, usr, %ID
FROM %Library.sys_SQLConnection
WHERE Connection_Name is not null
ORDER BY Connection_Name
Lookup by Connection name without input parameter
query ByName(name As %String = "")
Selects
Connection_Name, DSN, User, ID, isJDBC
SQL Query
:
SELECT Connection_Name, DSN, usr, %ID, isJDBC
FROM %Library.sys_SQLConnection
WHERE Connection_Name %STARTSWITH %ALPHAUP(:name)
ORDER BY Connection_Name
Lookup by Connection name
index (NameIndex on Name) [Unique];
Index for property Name