EnsLib.SQL.Snapshot
persistent class EnsLib.SQL.Snapshot extends %Library.Persistent, %Library.IResultSet, %XML.Adaptor
SQL Table Name: EnsLib_SQL.Snapshot
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 executedProperty Inventory
- %CurrentRow
- %GblRef
- %Message
- %PrivateTables
- %ROWCOUNT
- %ROWID
- %ResultColumnCount
- %SQLCODE
- AtEnd
- ColCount
- FirstRow
- MaxRowsToGet
- RowCount
- RuntimeMode
Method Inventory
- %Get()
- %GetData()
- %Next()
- %OnDelete()
- %ROWCOUNTGet()
- 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()
- XMLExportInternal()
- XMLImportInternal()
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 methods: %CurrentRowDisplayToLogical(), %CurrentRowGet(), %CurrentRowIsValid(), %CurrentRowLogicalToDisplay(), %CurrentRowNormalize(), %CurrentRowSet(), %CurrentRowXSDToLogical()
property %GblRef as %String (MAXLEN = 80) [ InitialExpression = $Name($$$EnsJobLocal($this)) ];
Location of the storage for the fields of this Snapshot.
Property methods: %GblRefDisplayToLogical(), %GblRefGet(), %GblRefGetStored(), %GblRefIsValid(), %GblRefLogicalToDisplay(), %GblRefLogicalToOdbc(), %GblRefNormalize(), %GblRefSet()
property %Message as %Library.String [ Transient ];
Property methods: %MessageDisplayToLogical(), %MessageGet(), %MessageIsValid(), %MessageLogicalToDisplay(), %MessageLogicalToOdbc(), %MessageNormalize(), %MessageSet()
property %PrivateTables as array of %XSQL.DS.TempTable [ Transient ];
Inherited description: %PrivateTables is an array of private temporary table orefs used by this result set subscripted by temp table name.
Property methods: %PrivateTablesBuildValueArray(), %PrivateTablesCollectionToDisplay(), %PrivateTablesCollectionToOdbc(), %PrivateTablesDisplayToCollection(), %PrivateTablesGet(), %PrivateTablesGetObject(), %PrivateTablesGetObjectId(), %PrivateTablesGetSwizzled(), %PrivateTablesIsValid(), %PrivateTablesOdbcToCollection(), %PrivateTablesSet(), %PrivateTablesSetObject(), %PrivateTablesSetObjectId()
property %ROWCOUNT as %Library.Integer [ Transient , ReadOnly ];
Property methods: %ROWCOUNTDisplayToLogical(), %ROWCOUNTIsValid(), %ROWCOUNTLogicalToDisplay(), %ROWCOUNTNormalize(), %ROWCOUNTSet(), %ROWCOUNTXSDToLogical()
property %ROWID as %String) [ Transient ];
Property methods: %ROWIDDisplayToLogical(), %ROWIDGet(), %ROWIDIsValid(), %ROWIDLogicalToDisplay(), %ROWIDLogicalToOdbc(), %ROWIDNormalize(), %ROWIDSet()
property %ResultColumnCount as %Library.Integer [ Transient , ReadOnly ];
Inherited description: %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 methods: %ResultColumnCountDisplayToLogical(), %ResultColumnCountIsValid(), %ResultColumnCountLogicalToDisplay(), %ResultColumnCountNormalize(), %ResultColumnCountXSDToLogical()
property %SQLCODE as %Library.Integer [ Transient ];
Property methods: %SQLCODEDisplayToLogical(), %SQLCODEGet(), %SQLCODEIsValid(), %SQLCODELogicalToDisplay(), %SQLCODENormalize(), %SQLCODESet(), %SQLCODEXSDToLogical()
property AtEnd as %Boolean [ Calculated , Transient , ReadOnly ];
Are we at the last row?
Property methods: AtEndDisplayToLogical(), AtEndIsValid(), AtEndLogicalToDisplay(), AtEndLogicalToXSD(), AtEndNormalize(), AtEndXSDToLogical()
property ColCount as %Integer [ Calculated , Transient , ReadOnly ];
This holds the column count for this snapshot
Property methods: ColCountDisplayToLogical(), ColCountIsValid(), ColCountLogicalToDisplay(), ColCountNormalize(), ColCountXSDToLogical()
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 methods: FirstRowDisplayToLogical(), FirstRowGet(), FirstRowGetStored(), FirstRowIsValid(), FirstRowLogicalToDisplay(), FirstRowNormalize(), FirstRowSet(), FirstRowXSDToLogical()
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 methods: MaxRowsToGetDisplayToLogical(), MaxRowsToGetGet(), MaxRowsToGetGetStored(), MaxRowsToGetIsValid(), MaxRowsToGetLogicalToDisplay(), MaxRowsToGetNormalize(), MaxRowsToGetSet(), MaxRowsToGetXSDToLogical()
property RowCount as %Integer [ Calculated , Transient , ReadOnly ];
This holds the row count
Property methods: RowCountDisplayToLogical(), RowCountIsValid(), RowCountLogicalToDisplay(), RowCountNormalize(), RowCountXSDToLogical()
property RuntimeMode as %String [ Transient ];
Property methods: RuntimeModeDisplayToLogical(), RuntimeModeGet(), RuntimeModeIsValid(), RuntimeModeLogicalToDisplay(), RuntimeModeLogicalToOdbc(), RuntimeModeNormalize(), RuntimeModeSet()
Methods
alias for Get in new result set interface
alias for GetData in new result set interface
Inherited description: 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
Inherited description: 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
method AddRow(pCol...) as %Status
method AtEndGet() as %Integer
method Clean() as %Status
method ColCountGet() as %Integer
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()
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
Returns the name of column n in the result set.
Returns whether column 'pColumn' contains binary data.
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.
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.
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.
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.
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.
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 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
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.
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.
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
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
Inherited description: XMLExportInternal is internal method used by XMLExport
method XMLImportInternal() as %Status
Inherited description: XMLImportInternal is internal method used by XMLImport
Indexes
index (IDKEY on ) [IdKey, Type = key];
Index methods: IDKEYCheck(), IDKEYDelete(), IDKEYExists(), IDKEYOpen(), IDKEYSQLCheckUnique(), IDKEYSQLExists(), IDKEYSQLFindPKeyByConstraint(), IDKEYSQLFindRowIDByConstraint()
Triggers
trigger OnDelete (BEFORE event DELETE);
Inherited Members
Inherited Properties
Inherited Methods
- %%CLASSNAMELogicalToStorage()
- %%CLASSNAMEStorageToLogical()
- %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()
- %GetLock()
- %GetMetadata()
- %GetParameter()
- %GetSwizzleObject()
- %Id()
- %InitExtentData()
- %InsertBatch()
- %IsA()
- %IsModified()
- %IsNull()
- %KillExtent()
- %KillExtentData()
- %LoadFromMemory()
- %LockExtent()
- %LockId()
- %New()
- %NormalizeObject()
- %ObjectIsNull()
- %ObjectModified()
- %Oid()
- %OnBeforeAddToSync()
- %OnDeleteFinally()
- %OnDetermineClass()
- %OnOpenFinally()
- %OnSaveFinally()
- %Open()
- %OpenId()
- %OriginalNamespace()
- %PackageName()
- %PhysicalAddress()
- %Prepare()
- %PrepareMetaData()
- %Print()
- %PurgeIndices()
- %Reload()
- %RemoveFromSaveSet()
- %ResolveConcurrencyConflict()
- %ResultColumnCountGet()
- %RollBack()
- %Save()
- %SaveDirect()
- %SaveIndices()
- %SendDelimitedRows()
- %SerializeObject()
- %SetModified()
- %SortBegin()
- %SortEnd()
- %SyncObjectIn()
- %SyncTransport()
- %UnlockExtent()
- %UnlockId()
- %ValidateIndices()
- %ValidateObject()
- %ValidateTable()
- XMLDTD()
- XMLExport()
- XMLExportToStream()
- XMLExportToString()
- XMLNew()
- XMLSchema()
- XMLSchemaNamespace()
- XMLSchemaType()
Storage
Storage Model: Storage (EnsLib.SQL.Snapshot)
^EnsLib.S.SnapshotD(ID) |
= | %%CLASSNAME
%Dummy
%GblRef
FirstRow
MaxRowsToGet
|