hidden class %UnitTest.ODBCSQL
extends %RegisteredObject, %UnitTest.Utility
The methods in this class are used by the SQLRegression class to execute SQL files using an ODBC SQL Gateway connection and return results in a stream.
They are subject to change, and not intended to be called directly.
parameter Password = "SYS";
Specify password for odbc database connection
Specify Super Server Port for odbc database connection
parameter Url = "127.0.0.1";
Specify url for odbc database connection
parameter Username = "_system";
Specify username for odbc database connection
classmethod getODBCDSN(dsn As %String = "")
Find or Add ODBC DSN dsn at System level
classmethod getODBCGateway(ByRef gcn As %String = "", ByRef dsn As %String = "")
Add or verify Gateway Connection
classmethod processLog(ByRef fnderr As %ListOfDataTypes, ByRef log As %Stream)
- gcn Gateway Connection Name will be verified or added
- dsn if value passed in we will add it to gcn if missing, but will not verify it at lower level
if you need to, call getODBCDSN first to create a dsn at the lower level and pass the name to this function
Return any errors found in log in fnderr list
classmethod processORSToStream(clist As %List, rlist As %List, err As %String = "", ByRef output As %Stream, verbose As %Boolean = 0, space As %Boolean = 1)
Write ResultSet out to Stream
If verbose=1 then also write column information to Stream with ResultSet
space must be 1 for SQLRegression and SQLDataRegression to correctly process tuples in each resultset row.
classmethod runODBCSQL(sqlfilename As %String, ByRef dsn As %String = "", verbose As %Boolean = 0)
Connect to ODBC and run SQL from sqlfilename in ANY namespace and return result as %Stream.
ODBC DSN is dynamically created by modifying the built-in "User" DSN
classmethod runODBCSQLStatement(sql As %String = "", ByRef dsn As %String = "", verbose As %Boolean = 0, Username As %String = "", Password As %String = "", ByRef RowCount As %Integer)
Connect to ODBC and run SQL statement in ANY namespace and return result as %Stream.
ODBC DSN and SQL Gateway Connection are created if they don't exist, or used if they do.
DSN and Gateway name is " "
Username and Password can be passed as argument or as class parameter
If verbose is 1 the column information is included in the resultset.