Learning
Documentation
Community
Open Exchange
Global Masters
Home / Class Reference / ENSLIB namespace / EnsLib.SQL.Snapshot
Private  Storage   

EnsLib.SQL.Snapshot


persistent class EnsLib.SQL.Snapshot extends
%Persistent, %IResultSet, %XML.Adaptor

This class is a specialized result set used with the EnsLib.SQL.OutboundAdapter Instances are returned as output from EnsLib.SQL.OutboundAdapter.ExecuteQuery(). The list of rows is a static snapshot as of the time when the query was executed

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
19 62 1


Summary


Properties
%CurrentRow %GblRef %Message %Metadata
%PrivateTables %ROWCOUNT %ROWID %ResultColumnCount
%SQLCODE AtEnd ColCount FirstRow
MaxRowsToGet RowCount RuntimeMode

Methods
%AddToSaveSet %AddToSyncSet %BMEBuilt %BuildIndicesAsync
%BuildIndicesAsyncResponse %CheckConstraints %CheckConstraintsForExtent %ClassIsLatestVersion
%ClassName %ComposeOid %ConstructClone %CreateSnapshot
%Delete %DeleteExtent %DeleteId %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %Display %DisplayFormatted %Exists
%ExistsId %Extends %GUID %GUIDSet
%Get %GetData %GetLock %GetMetadata
%GetParameter %GetSwizzleObject %Id %InsertBatch
%IsA %IsModified %IsNull %KillExtent
%KillExtentData %LoadFromMemory %LockExtent %LockId
%New %Next %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDelete
%OnDetermineClass %Open %OpenId %OriginalNamespace
%PackageName %PhysicalAddress %Prepare %PrepareMetaData
%Print %PurgeIndices %ROWCOUNTGet %Reload
%RemoveFromSaveSet %ResolveConcurrencyConflict %ResultColumnCountGet %RollBack
%Save %SaveDirect %SaveIndices %SendDelimitedRows
%SerializeObject %SetModified %SortBegin %SortEnd
%SyncObjectIn %SyncTransport %UnlockExtent %UnlockId
%ValidateIndices %ValidateObject AddRow AtEndGet
Clean ColCountGet CreateFromFile CreateFromResultSet
CreateFromStream FromResultset GenerateIResultSetMetadata Get
GetColumnCount GetColumnExtInfo GetColumnID GetColumnIsBinary
GetColumnIsLOB GetColumnLabelName GetColumnName GetColumnOptions
GetColumnQualifier GetColumnSQLType GetColumnScale GetColumnSchemaName
GetColumnSize GetColumnTableName GetColumnType GetColumnisNullable
GetData GetDataByName GetDataStream GetODBCInfo
GetRowList GetStream HasDataStream HasStream
ImportFile ImportFromResultSet ImportFromStream Next
QueryIsValid Rewind RowCountGet SetColLabelName
SetColNames SetColOptions SetColQualifier SetColScales
SetColSchemaName SetColSizes SetColTableName SetColTypes
SetColisNullable XMLDTD XMLExport XMLExportInternal
XMLExportToStream XMLExportToString XMLImportInternal XMLNew
XMLSchema XMLSchemaNamespace XMLSchemaType


Properties


• property %CurrentRow as %Integer [ InitialExpression = 0,Transient ];
This is the index of the 'current' row in the Snapshot. Used by the Next(), Get(), GetData(), and Rewind() methods.
• property %GblRef as %String(MAXLEN=80) [ InitialExpression = $Name($$$EnsJobLocal($this)) ];
Location of the storage for the fields of this Snapshot.
• property %Message as %Library.String [ Transient ];
• property %PrivateTables as array of %XSQL.DS.TempTable [ Transient ];
%PrivateTables is an array of private temporary table orefs used by this result set subscripted by temp table name.
• property %ROWCOUNT as %Library.Integer [ Transient,ReadOnly ];
• property %ROWID as %String(MAXLEN="") [ Transient ];
• property %ResultColumnCount as %Library.Integer [ Transient,ReadOnly ];
%ResultColumnCount is the number of columns in the result set. This value is always zero unless the current result is a RESULTSET object (instance of %SQL.IResultSet) or a procedure context object (instance of %Library.IProcedureContext). For a CALL statement result, this value represents the column count of the result set currently bound. For more information on result set sequences and dynamic result set binding refer to <>.
• property %SQLCODE as %Library.Integer [ Transient ];
• property AtEnd as %Boolean [ Calculated,Transient,ReadOnly ];
Are we at the last row?
• property ColCount as %Integer [ Calculated,Transient,ReadOnly ];
This holds the column count for this snapshot
• property FirstRow as %Integer [ InitialExpression = 1 ];
The index of the first row in this Snapshot. May be set on input when calling OutboundAdapter.ExecuteQuery() or ResultSet.GetSnapshot() to cause the first n-1 rows to be discarded before populating the Snapshot.
• property MaxRowsToGet as %Integer [ InitialExpression = 250 ];
The maximum number of rows to populate this Snapshot with. May be set on input to OutboundAdapter.ExecuteQuery() or ResultSet.GetSnapshot(). Set to -1 to get all rows no matter how many.
• property RowCount as %Integer [ Calculated,Transient,ReadOnly ];
This holds the row count
• property RuntimeMode as %String [ Transient ];

Methods


• method %Get(pColName As %String, pRow As %Integer) as %String
alias for Get in new result set interface
• method %GetData(pColumn As %Integer, pRow As %Integer) as %String
alias for GetData in new result set interface
• method %Next(ByRef pSC As %Status) as %Integer
Advance the result set cursor to the next row. Returns 0 if the cursor is at the end of the result set.
• classmethod %OnDelete(oid As %ObjectIdentity) as %Status
This callback method is invoked by the %Delete method to provide notification that the object specified by oid is being deleted.

If this method returns an error then the object will not be deleted.

• method %ROWCOUNTGet() as %Integer
This is a Get accessor method for the %ROWCOUNT property.
• method AddRow(pCol...) as %Status
• method AtEndGet() as %Integer
This is a Get accessor method for the AtEnd property.
• method Clean() as %Status
• method ColCountGet() as %Integer
This is a Get accessor method for the ColCount property.
• classmethod CreateFromFile(pFilename As %String, pRowSeparator As %String, pColumnSeparator As %String, pColumnWidths As %String, pLineComment As %String, pStripPadChars As %String, pColNamesRow As %Integer, pFirstRow As %Integer, pMaxRowsToGet As %Integer, Output pStatus As %Status) as Snapshot
Creates a new Snapshot object and loads it with data from a table-formatted text file
• classmethod CreateFromResultSet(pRS As %ResultSet, pLegacyMode As %Integer = 1, pODBCColumnType As %Boolean = 0, pFirstRow As %Integer, pMaxRowsToGet As %Integer, Output pStatus As %Status) as Snapshot
Creates a new Snapshot object and loads it with data from another resulset. See ImportFromResultSet method.
• classmethod CreateFromStream(pIOStream As %IO.I.CharacterStream, pRowSeparator As %String, pColumnSeparator As %String, pColumnWidths As %String, pLineComment As %String, pStripPadChars As %String, pColNamesRow As %Integer, pFirstRow As %Integer, pMaxRowsToGet As %Integer, Output pStatus As %Status) as Snapshot
Creates a new Snapshot object and loads it with data from a table-formatted character stream
• classmethod FromResultset(pRS As %ResultSet) as %Status
Deprecated - use CreateFromResultSet method
• method GenerateIResultSetMetadata()
• method Get(pColName As %String, pRow As %Integer = ..%CurrentRow) as %String
Returns the value of the column with the name 'pColName' in the current row of the result set Note: if the data exceeds the maximum string length then the return value will be the first 50 characters plus "..." and you should call GetStream() to get the full value.
• method GetColumnCount() as %Integer
Returns the number of columns in the result set
• method GetColumnExtInfo(n As %Integer) as %String
Returns the name of column n in the result set.
• method GetColumnID(pColName As %String) as %Integer
• method GetColumnIsBinary(pColumn As %Integer = 0) as %Boolean
Returns whether column 'pColumn' contains binary data.
• method GetColumnIsLOB(pColumn As %Integer = 0) as %Boolean
Returns whether column 'pColumn' is a LOB (Stream) column.
• method GetColumnLabelName(pColumn As %Integer = 0)
Returns the LabelName of column 'pColumn' in the result set.
• method GetColumnName(pColumn As %Integer = 0) as %String
Returns the name of column 'pColumn' in the result set.
• method GetColumnOptions(pColumn As %Integer = 0)
Returns the Options of column 'pColumn' in the result set.
• method GetColumnQualifier(pColumn As %Integer = 0)
Returns the Qualifier of column 'pColumn' in the result set.
• method GetColumnSQLType(pColumn As %Integer = 0) as %Integer
Returns the SQLtype integer of column 'pColumn' in the result set.
• method GetColumnScale(pColumn As %Integer = 0)
Returns the scale of column 'pColumn' in the result set.
• method GetColumnSchemaName(pColumn As %Integer = 0)
Returns the Schema name of column 'pColumn' in the result set.
• method GetColumnSize(pColumn As %Integer = 0)
Returns the size of column 'pColumn' in the result set.
• method GetColumnTableName(pColumn As %Integer = 0)
Returns the Table of column 'pColumn' in the result set.
• method GetColumnType(pColumn As %Integer = 0) as %String
Returns the type name of column 'pColumn' in the result set.
• method GetColumnisNullable(pColumn As %Integer = 0)
Returns the isNullable of column 'pColumn' in the result set.
• method GetData(pColumn As %Integer, pRow As %Integer = ..%CurrentRow) as %String
Returns the value of column pColumn in the current row of the result set. Note: if the data exceeds the maximum string length then the return value will be the first 50 characters plus "..." and you should call GetDataStream() to get the full value.

• method GetDataByName(pColName As %String) as %String
Deprecated - use Get method
• method GetDataStream(pColumn As %Integer, ByRef pStream As %Stream.Object = $$$NULLOREF, pRow As %Integer = ..%CurrentRow) as %Stream.Object
Returns as a Stream the full value of column pColumn in the current row of the result set. If you pass a stream object in pStream, the data will be appended to that stream; otherwise the data will be returned in a new %Stream.GlobalCharacter stream object. Note that if this method creates a Stream object for you, the Stream data is already on disk and you are responsible for calling stream.%Delete(stream.%Oid()) to delete the persistent storage for the new stream object
• method GetODBCInfo(ByRef colinfo As %List, ByRef parminfo As %List) as %Status
• method GetRowList() as %String
• method GetStream(pColName As %String, ByRef pStream As %Stream.Object = $$$NULLOREF, pRow As %Integer = ..%CurrentRow) as %Stream.Object
Returns as a Stream the full value of the column with the name 'pColName' in the current row of the result set. If you pass a stream object in pStream, the data will be appended to that stream; otherwise the data will be returned in a new %Stream.GlobalCharacter stream object. Note that if this method creates a Stream object for you, the Stream data is already on disk and you are responsible for calling stream.%Delete(stream.%Oid()) to delete the persistent storage for the new stream object
• method HasDataStream(pColumn As %Integer, pRow As %Integer = ..%CurrentRow) as %Boolean
Returns true if the given field in the current row contains stream data. In this case the complete value for the field can only be retrieved using the GetStream() or GetDataStream() method. Otherwise the field contains simple string data that can be retrieved completely using the Get() or GetData() method.
• method HasStream(pColName As %String, pRow As %Integer = ..%CurrentRow) as %Boolean
Returns true if the named column in the current row contains stream data. In this case the complete value for the field can only be retrieved using the GetStream() or GetDataStream() method. Otherwise the field contains simple string data that can be retrieved completely using the Get() or GetData() method.
• method ImportFile(pFilename As %String, pRowSeparator As %String = $C(10), pColumnSeparator As %String = $C(9), pColumnWidths As %String = "", pLineComment As %String = "", pStripPadChars As %String = " "_$C(9), pColNamesRow As %Integer = 0) as %Status
• method ImportFromResultSet(pRS As %ResultSet, pLegacyMode As %Integer = 1, pODBCColumnType As %Boolean = 0) as %Status
Import a result set into a Snapshot ResultSet classes supported: EnsLib.SQL.GatewayResultSet, %Library.ResultSet, %ResultSet.* (%Library.IResultSet) as well as the result sets in %SQL package such as %SQL.StatementResult and %SQL.ISelectResult (%SQL.IResult) If pLegacyMode is specified as 0 then attempt first to use %GetMetadata leading to different source of meta data for legacy ResultSet class Default is 1 which maintains previous behavior while still supporting %SQL.* and %ResultSet.* classes. If pODBCColumnType is set to 1 then ColumntType text is set to the ODBC type column type text and not the clientType.
• method ImportFromStream(pIOStream As %IO.I.CharacterStream, pRowSeparator As %String = $C(10), pColumnSeparator As %String = $C(9), pColumnWidths As %String = "", pLineComment As %String = "", pStripPadChars As %String = " "_$C(9), pColNamesRow As %Integer = 0) as %Status
Imports data from a table-formatted text file - negative pRowSeparator means row length - zero or negative pColumnSeparator means positional columns; negative pColumnSeparator gives # char columns to skip - pColumnWidths means comma-separated list of char counts if positional, or integer column count if using column separator. - pLineComment means a string after which the rest of a row should be ignored - pStripPadChars means characters to strip from the beginning and end of a field - pColNamesRow means the index of a row that contains column names.
• method Next(ByRef pSC As %Status) as %Integer
Advance the result set cursor to the next row. Returns 0 if the cursor is at the end of the result set.
• method QueryIsValid() as %Integer
Returns true (1) if the ClassName and QueryName properties of this %ResultSet object refer to a valid class query. Otherwise it returns false (0).
• method Rewind() as %Status
• method RowCountGet() as %Integer
This is a Get accessor method for the RowCount property.
• method SetColLabelName(pCollabel...) as %Status
• method SetColNames(pColName...) as %Status
• method SetColOptions(pColoptions...) as %Status
• method SetColQualifier(pColqualifier...) as %Status
• method SetColScales(pColScale...) as %Status
• method SetColSchemaName(pColschema...) as %Status
• method SetColSizes(pColSize...) as %Status
• method SetColTableName(pColtable...) as %Status
• method SetColTypes(pColType...) as %Status
• method SetColisNullable(pColisNul...) as %Status
• method XMLExportInternal() as %Status
XMLExportInternal is internal method used by XMLExport
• method XMLImportInternal() as %Status
XMLImportInternal is internal method used by XMLImport

Triggers


•trigger OnDelete (BEFORE event DELETE)