%Library.SQLImportMgr
Class %Library.SQLImportMgr Extends (%RegisteredObject, %SQLExImData) [ Inheritance = right, Not ProcedureBlock, System = 3 ]
Import Controller for SQL Import.
Parameters
RTNPREFIX
Parameter RTNPREFIX = "SQLImport";
Properties
DeferIndices
Property DeferIndices As %Integer [ InitialExpression = 1 ];
If true, generate indices after importing data.
UseTransaction
Property UseTransaction As %Integer [ InitialExpression = 0 ];
If true, nest the entire import operation in a transaction.
NOT IMPLEMENTED.
IndexPending
Property IndexPending As %Integer [ InitialExpression = 0, Private ];
If true, we still need to build indices.
Methods
Reset
Method Reset()
Reset the state of this object.
GenerateImportRoutine
Method GenerateImportRoutine() As %Status
Generate the Import routine.
DeleteImportRoutine
Method DeleteImportRoutine() As %Status
Delete the generated import routine.
FileSize
Method FileSize() As %Integer
Returns the size of the import file.
ErrorCount
Method ErrorCount() As %Integer
Returns the current number of import errors.
Import
Method Import(savertn As %Boolean = 0)
Do an import from the command line.
OpenImport
Method OpenImport() As %Status
Prepares the start of an import.
Call this after generating an import routine.
ImportRows
Method ImportRows(ByRef count As %Integer, ByRef inserted As %Integer, ByRef bytes As %Integer, ByRef done As %Integer, ByRef errorcount As %Integer) As %Status
Reads the next count rows from the import file.
On return, counts contains the number of rows read from the file. inserted contains the number of rows successfully inserted. bytes contains the number of bytes read from the file. done is set to one when the import is complete. errorcount is the cumulative number of INSERT errors encountered.
BuildIndices
Method BuildIndices() As %Status
Perform the merge sort to build the indices.
ReadHeader
Method ReadHeader(ByRef header As %String, ByRef size As %Integer) As %Status
Reads the first line of the import file.
CloseImport
Method CloseImport(abort As %Integer = 0) As %Status
Call this at the end of the import operation.
ErrorLogExecute
ClassMethod ErrorLogExecute(ByRef QHandle As %Binary) As %Status
ErrorLogClose
ClassMethod ErrorLogClose(QHandle As %Binary) As %Status
ErrorLogFetch
ClassMethod ErrorLogFetch(ByRef QHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status