Home > Class Reference > ENSLIB namespace > %iKnow.Source.SQL.Lister
Private  

%iKnow.Source.SQL.Lister

class %iKnow.Source.SQL.Lister extends %iKnow.Source.Lister

Lister implementation for retrieving sources corresponding to records in a query result.

Lister Parameters to be supplied to AddListToBatch and ProcessList calls:

  1. query As %String - the query to fetch the data from, wherein each returned row corresponds to an individual source to be indexed.
  2. idField As %String - the column retrieved by the query that contains the identifier we can use as the LocalReference for the source to be stored. Values for this column should not contain colon characters.
  3. groupField As %String - the column retrieved by the query that contains the group name to use as for the source to be stored.
  4. dataFields As %List - the columns retrieved by the query that contain the data to be indexed (currently %String only).
  5. metaFields As %List - the columns retrieved by the query that contain the metadata attributes to set for this source.
  6. metaKeys As %List - the metadata field names, corresponding to the entries in metaFields (if left blank, we assume the column names correspond to the metadata field names).
  7. multiDataFieldMode As %Integer - 0 = concatenate dataFields (default), 1 = store as separate sources (colon+dataField pos is postfixed to idField value).
  8. concatSeparator As %String - separator to use for concatenating multiple fields (default " ").

External ID structure: [GroupName]:[LocalRef]

Lister alias: "SQL"

Default Processor: %iKnow.Source.Temp.Processor

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
5

Summary

Properties
Configuration
Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
AddListToBatch BuildExtId BuildExtIdFromName DefaultProcessor
ExpandList FormatParams GetAlias GetExtidPrefix
GetGroupId GetGroupName Init ProcessList
ProcessVirtualList RegisterFixedMetadata SetConfig SetConverter
SetProcessor SplitExtId TestParams

Methods

classmethod DefaultProcessor() as %String

Default Processor: %iKnow.Source.Temp.Processor

method ExpandList(listparams As %List) as %Status

Triggers the query and loops through the results, listing each row as a separate source (exception: when multiDataFieldMode = 1). Metadata is retrieved and stored as specified by the metaFields and metaKeys parameters.

In the current implementation, the data columns are also fetched and stored locally using StoreTemp.

classmethod FormatParams(listerParams As %List) as %String

Utility method to format the parameter string passed in AddList for display by the %iKnow.Source.Loader.GetCurrentLists() method. Defaults to $lts() but should be overridden to nicen up complex datatypes in the parameter list.

classmethod GetAlias() as %String

Lister alias: "SQL"

method TestParams(listerParams...) as %Status

Tests performed by this Lister:

  1. query: checks whether this is a valid SQL statement (type SELECT or CALL)
  2. idField: checks whether this is a valid column, returned by the above query
  3. groupField: checks whether this is a valid column, returned by the above query
  4. dataFields: checks whether these are valid columns, returned by the above query
  5. metaFields: checks whether these are valid columns, returned by the above query
  6. metaKeys: checks whether these are existing metadata fields
  7. multiDataFieldMode: no checks
  8. concatSeparator: no checks