Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [%UnitTest] >  [ODBCSQL]
Private  Storage   

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.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
4 7


Summary

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
FindClass Occurs convertSQL countCachedQuery
countGlobalRefs crossVerify describe diffData
diffExpectedByStream diffPlan genPlan getColumn
getData getFromPlan getODBCDSN getODBCGateway
getSqlCode getSqlExec ltrim processLog
processORSToStream rewindLine rtrim runODBCSQL
runODBCSQLStatement stripChar trim typeNameByType

Subclasses
%UnitTest.TSQL

Parameters

• parameter Password = "SYS";
Specify password for odbc database connection
• parameter Port;
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

Methods

• classmethod getODBCDSN(dsn As %String = "") as %Status
Find or Add ODBC DSN dsn at System level
• classmethod getODBCGateway(ByRef gcn As %String = "", ByRef dsn As %String = "") as %Status
Add or verify Gateway Connection
  1. gcn Gateway Connection Name will be verified or added
  2. 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
• classmethod processLog(ByRef fnderr As %ListOfDataTypes, ByRef log As %Stream) as %Status
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) as %Status
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) as %Stream
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) as %Stream
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.


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.