DocBook|Search
Class Reference
%SYS.PTools.SQLQuery
   
Server:basexml
Instance:SOAXML
User:UnknownUser
 
-
  [BASEXML] >  [%SYS] >  [PTools] >  [SQLQuery]
Private  Storage  

persistent class %SYS.PTools.SQLQuery extends %Persistent

This is the parent class of %SYS_PTools.SQLStats.

This class stores the general info of a query from compile time: QueryText, QueryType, CursorName, RoutineName, and NameSpace. All of the run time data is stored in the %SYS_PTools.SQLStats class.

Error information is stored in ^%SYS.PTools.SQLQuery("Error",$j) Caché SQL Manager.

These classes are storing the data in globals that default to the %SYS NameSpace: ^%SYS.PTools.SQLQueryD, ^%SYS.PTools.SQLQueryC, and ^%SYS.PTools.SQLQueryI. If you are going to run this on a large system for some time you might want to create global mapping to move these globals out of %SYS to a different database.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
8 1 1


Summary

Properties
CompileTime CursorName InternalQueryText NameSpace
QueryText QueryType RoutineName SQLStatsPointer

Methods
%%OIDGet %AddToSaveSet %AddToSyncSet %BMEBuilt
%BuildIndices %CheckUnique %ClassIsLatestVersion %ClassName
%ComposeOid %ConstructClone %Delete %DeleteExtent
%DeleteId %DispatchClassMethod %DispatchGetModified %DispatchGetProperty
%DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty
%Exists %ExistsId %Extends %GUID
%GUIDSet %GetLock %GetParameter %GetSwizzleObject
%Id %InsertBatch %IsA %IsModified
%KillExtent %KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject %ObjectModified
%Oid %OnBeforeAddToSync %OnDetermineClass %Open
%OpenId %OriginalNamespace %PackageName %PhysicalAddress
%PurgeIndices %Reload %RemoveFromSaveSet %ResolveConcurrencyConflict
%RollBack %Save %SaveDirect %SaveIndices
%SerializeObject %SetModified %SortBegin %SortEnd
%SyncObjectIn %SyncTransport %UnlockExtent %UnlockId
%ValidateObject NewQuery


Properties

• property CompileTime as %Numeric;
Number of Seconds it takes to compile the query
• property CursorName as %String;
What is the name of the cursor for this SQL Statement
• property InternalQueryText as %String(MAXLEN=15000,TRUNCATE=1);
• property NameSpace as %String;
What NameSpace the SQL was generated in
• property QueryText as %String(MAXLEN=15000,TRUNCATE=1) [ Calculated ];
Store the first 15000 charactors of the SQL Query in this field.
• property QueryType as %String;
Is the Query an INSERT UPDATE DELETE or SELECT query
• property RoutineName as %String;
What Routine is the SQL generated in
• relationship SQLStatsPointer as %SYS.PTools.SQLStats [ Inverse = SQLQueryPointer,Cardinality = children ];

Methods

• classmethod NewQuery(ByRef SQLText As %String, SQLType As %String, NameSpace As %String, RoutineName As %String, CursorName As %String, CompileTime As %Numeric = 0) as %Status
This method is called at compile time for a query It deletes all current stats for this query, as they could be very different after the compile

Indices

• index (master on NameSpace,RoutineName,CursorName) [IdKey,Unique];