Open Exchange
Global Masters
Home / Class Reference / %SYS namespace / %SQL.DynamicStatement
Private  Storage   


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.


Parameters Properties Methods Queries Indices ForeignKeys Triggers


Prepare findStatement swap


• 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) 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;
• classmethod findStatement(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) as %String
• classmethod swap(extent, irn, exp, visited)