%SQL.DynamicStatement
hidden abstract class %SQL.DynamicStatement
This is the Dynamic Statement Library Manager class. It implements the cached statement LookupCache method and automatically dispatches to generate a new cached statement implementation if an existing statement implementation is not found.Method Inventory
Methods
classmethod Prepare(pStatementId As %String = "", ByRef pStatementText As %RawString = "", pStatementImports As %RawString = "", pSchemaPath As %RawString = "", ByRef pStatementHash As %Binary = "", ByRef pStatementType As %Library.Integer, pObjectMode As %Library.Boolean = 0, pDialect As %Library.String = "", pStatement As %SQL.Statement = $$$NULLOREF, checkPriv As %Boolean = 1, dialectParameterMetadata As %String = "") as %Library.ObjectHandle
Prepare() - this method must be invoked within a try/catch bas it throws an exception.
This method is responsible for accepting an SQL statement and preparing an implementation of that statement.
The implementation is an instance of a class that is a subclass of the statement type class (CURSOR = result set, non-cursor is a simple statement class, etc)
The first task of prepare is to lookup the statement in the prepared statement cache by calling findStatement.
Parameters:
pStatementId
pStatementText
pStatementImports
pSchemaPath : this is a comma delimited list of schema names. Generic tokens such as CURRENT_PATH and CURRENT_SCHEMA have been replaced with actual names
pStatementHash : the hash key computed from the prequalifiers and the statement text (pStatementText)
pStatementType : the integer identifying the type of statement contained in pStatementText
pObjectMode : Object Select Mode
pDialect : The statement dialect, CACHE, MSSQL[SERVER], Sybase, and DOCTYPE. DOCTYPE is used for caching json_columns_expression statements and other DocDB Types;
classmethod findStatement(ByRef pStatementLR, pStatementImports As %RawString = "", pSchemaPath As %RawString = "", ByRef pTableList As %Library.List = "", ByRef pStatementHash As %Binary = "", ByRef pStatementType As %Integer = 99, pObjectMode As %Library.Boolean = 0, pDialect As %Library.String = "", pStatement As %SQL.Statement, pRuntimeClassName As %String = "", pmsqlvar="", pUtilityClassName As %String = "", checkPriv As %Boolean = 1, dialectParameterMetadata As %String = "") as %String
classmethod prepareJSONTable(jsonTableRequest As %RawString = "") as %Library.DynamicAbstractObject
This is a trimmed down Prepare specifically for the purposes of preparing special cached statements for DOCTYPE (JSON_TABLE), etc.
The table list for a type will include one or more collection names (syscollections) and perhaps a type name (systypes).