Skip to main content

%SQL.Diag.Result

persistent class %SQL.Diag.Result extends %Library.Persistent

SQL Table Name: %SQL_Diag.Result

Property Inventory

Method Inventory

Parameters

parameter DEFAULTGLOBAL = ^IRIS.sql.diag.result;
Inherited description:

If a persistent class uses %Storage.Persistent then the DEFAULTGLOBAL parameter is used as the default global root for the values of the storage keywords COUNTERLOCATION, DATALOCATION, IDLOCATION, INDEXLOCATION and STREAMLOCATION in the active storage definition. DEFAULTGLOBAL is only used to generate location keyword values that are not already defined. The location value is constructed by adding a location type to the end of DEFAULTGLOBAL. For example, if DEFAULTGLOBAL = "^GL.Account" the compiler will generate DATALOCATION = ^GL.AccountD.

If USEEXTENTSET is true, then DEFAULTGLOBAL is used as the default extent location.


The location types are:
LocationType
COUNTERLOCATIONC
DATALOCATIOND
IDLOCATIOND
INDEXLOCATIONI
STREAMLOCATIONS
parameter SQLPUBLICSECURITY = {"Result":"S","add_diag_result":"E","add_diag_message":"E"};
parameter USEEXTENTSET = 1;
Inherited description:

If a persistent class uses %Storage.Persistent then the USEEXTENTSET parameter is used to specify the global naming strategy used by the default storage class (%Storage.Persistent). If TRUE, then global names are generated for each index that is not already allocated a LOCATION in the active storage definition.

If the storage definition specifies EXTENTLOCATION then that value is used as the base reference for all globals assigned to indices that do not have an explicit LOCATION assigned.

The global name generator for USEEXTENTSET = TRUE honors the package prefix defined in the Package Definition. If none is defined then the package prefix is generated using a based-62 encoded integer produced from CRC32 of the package name. The specific class identifier is generated from the unqualified class name using the same hash (class->crc32->base62) to form EXTENTLOCATION. Specific index suffixes are produced using a generated offset that is local to the first persistent class with an enumerated extent in which the index appears (either defined or inherited).

There are several factors that influence the generation of EXTENTLOCATION:

  1. If the EXTENTLOCATION keyword is defined then its value is used,
  2. If the DEFAULTGLOBAL class parameter is defined then its value is used,
  3. otherwise, the value is generated as two dot delimited segments. The first segment is either the defined package prefix retrieved from the package definition global or, if none is defined, a hash of the package name. The second segment is generated by a hash of the unqualified class name. The hash used is a base 62 encoded CRC32 of the value. For example, Sample.Person produces ^EW3K.wPC9 if no package prefix is defined.
The EXTENTLOCATION value is used as the base for specific globals allocated to indices. Each index is assigned an offset that is incremented from 1 by 1, offset = 1 is reserved for the IDKEY index.

EXTENTLOCATION is specific to each class. When a persistent class extends another persistent class, forming a subextent, then the subclass's EXTENTLOCATION is specific to that subclass. The index location for any inherited index is already defined specifically in the superclass so the subclass's EXTENTLOCATION will only be used as the base for any index that originates in the subclass. For example, Sample.Employee extends Sample.Person. The EXTENTLOCATION generated for Sample.Person is ^EW3K.wPC9 and the EXTENTLOCATION for Sample.Employee is ^EW3K.D1Ex. Since Sample.Employee inherits several indices from Sample.Person, the global name assigned to each of those indices is already defined and inherited by Sample.Employee. However, any index defined in Sample.Employee and not inherited from Sample.Person will be assigned a global name based on Sample.Employee's EXTENTLOCATION, not on Sample.Person's EXTENTLOCATION. In other words, the EXTENTLOCATION storage keyword is not inherited.

The following tables show the indices and locations for Sample.Person and Sample.Employee. Notice the last index in the Sample.Employee table:

Class = Sample.Person
IndexLocation
IDKEY^EW3K.wPC9.1
$Person^EW3K.wPC9.2
NameIDX^EW3K.wPC9.3
SSNKey^EW3K.wPC9.4
ZipCode^EW3K.wPC9.5
Class = Sample.Employee extends Sample.Person
IndexLocation
IDKEY^EW3K.wPC9.1
$Person^EW3K.wPC9.2
NameIDX^EW3K.wPC9.3
SSNKey^EW3K.wPC9.4
ZipCode^EW3K.wPC9.5
$Employee^EW3K.D1Ex.2

Any generated global index locations and EXTENTLOCATION are updated back into the active storage definition after the class is compiled.

If USEEXTENTSET is FALSE, then global names are generated using the package-hash.class-hashSuffix strategy. For example, ^Sample.PersonD and ^Sample.PersonI("SSNKey") are globals used by Sample.Person and specific index structures are all stored in ^Sample.PersonI with the index name used as the first subscript.


Properties

property createTime as %PosixTime [ ReadOnly ];
Property methods: createTimeCompute(), createTimeCurrentTimeStamp(), createTimeCurrentUTCTimeStamp(), createTimeDateToLogical(), createTimeDisplayToLogical(), createTimeGet(), createTimeGetStored(), createTimeIsValid(), createTimeLogicalToDate(), createTimeLogicalToDisplay(), createTimeLogicalToOdbc(), createTimeLogicalToTime(), createTimeLogicalToTimeStamp(), createTimeLogicalToUnixTime(), createTimeNormalize(), createTimeOdbcToLogical(), createTimeSQLCompute(), createTimeSetT(), createTimeTimeStampToLogical(), createTimeTimeToLogical(), createTimeUnixTimeToLogical()
property errorCount as %Integer;
Property methods: errorCountDisplayToLogical(), errorCountGet(), errorCountGetStored(), errorCountIsValid(), errorCountLogicalToDisplay(), errorCountNormalize(), errorCountSet()
property inputRecordCount as %Integer;
Property methods: inputRecordCountDisplayToLogical(), inputRecordCountGet(), inputRecordCountGetStored(), inputRecordCountIsValid(), inputRecordCountLogicalToDisplay(), inputRecordCountNormalize(), inputRecordCountSet()
property maxErrorCount as %Integer;
Property methods: maxErrorCountDisplayToLogical(), maxErrorCountGet(), maxErrorCountGetStored(), maxErrorCountIsValid(), maxErrorCountLogicalToDisplay(), maxErrorCountNormalize(), maxErrorCountSet()
property namespace as %String;
Property methods: namespaceDisplayToLogical(), namespaceGet(), namespaceGetStored(), namespaceIsValid(), namespaceLogicalToDisplay(), namespaceLogicalToOdbc(), namespaceNormalize(), namespaceSet()
property processId as %String;
Property methods: processIdDisplayToLogical(), processIdGet(), processIdGetStored(), processIdIsValid(), processIdLogicalToDisplay(), processIdLogicalToOdbc(), processIdNormalize(), processIdSet()
property resultId as %Library.Integer;
Property methods: resultIdDisplayToLogical(), resultIdGet(), resultIdGetStored(), resultIdIsValid(), resultIdLogicalToDisplay(), resultIdNormalize(), resultIdSet()
property sqlcode as %Integer;
Property methods: sqlcodeDisplayToLogical(), sqlcodeGet(), sqlcodeGetStored(), sqlcodeIsValid(), sqlcodeLogicalToDisplay(), sqlcodeNormalize(), sqlcodeSet()
property statement as %String (MAXLEN = 32768);
Property methods: statementDisplayToLogical(), statementGet(), statementGetStored(), statementIsValid(), statementLogicalToDisplay(), statementLogicalToOdbc(), statementNormalize(), statementSet()
property status as %String (MAXLEN = 20);
Property methods: statusDisplayToLogical(), statusGet(), statusGetStored(), statusIsValid(), statusLogicalToDisplay(), statusLogicalToOdbc(), statusNormalize(), statusSet()
property user as %String;
Property methods: userDisplayToLogical(), userGet(), userGetStored(), userIsValid(), userLogicalToDisplay(), userLogicalToOdbc(), userNormalize(), userSet()

Methods

method %ToJSON() as %String
classmethod addDiagMessage(resultId As %Integer, actor As %String, sqlcode As %Integer, message As %String(MAXLEN=""), severity As %Integer) [ SQLProc = add_diag_message ]
Projected as the stored procedure: add_diag_message
SEVERITY_COMPLETED = 0; SEVERITY_INFO = 1; SEVERITY_WARNING = 2; SEVERITY_ERROR = 3; SEVERITY_ABORT = 4;
classmethod addDiagResult(maxErrorCount As %Integer = 0) as %Integer [ SQLProc = add_diag_result ]
Projected as the stored procedure: add_diag_result
classmethod getLastResultId() as %SQL.Diag.Result [ SQLProc = get_last_result_id ]
Projected as the stored procedure: get_last_result_id
classmethod updateInputCount(resultId As %Integer, inputCount As %Integer)
classmethod updateResult(resultId As %Integer, inputCount As %Integer, sqlcode As %Integer)
classmethod updateStatement(resultId As %Integer, ByRef statement As %String(MAXLEN=32768))
classmethod updateStatus(resultId As %Integer, status As %String)

Indexes

index (IDKEY on resultId) [IdKey, Type = key];
Index methods: IDKEYCheck(), IDKEYDelete(), IDKEYExists(), IDKEYOpen(), IDKEYSQLCheckUnique(), IDKEYSQLExists(), IDKEYSQLFindPKeyByConstraint(), IDKEYSQLFindRowIDByConstraint()

Inherited Members

Inherited Methods

Storage

Gray indicates storage defined by superclasses.

Storage Model: Storage (%SQL.Diag.Result)

^IRIS.sql.diag.result.1(ID)
=
user
processId
namespace
createTime
sqlcode
inputRecordCount
errorCount
maxErrorCount
loadStatement
statement
status
FeedbackOpens in a new tab