InterSystems IRIS Data Platform 2021.1Opens in a new window > Class Reference > %SYS namespace > %iKnow.Source.SQL.Lister

%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

Method Inventory (Including Private)

Methods (Including Private)

private classmethod BuildFullRef(domainId As %Integer, groupName As %String, localRef As %String) as %String [ Language = objectscript ]

Builds the full reference by appending the local reference to the group name, adding a colon as a separator in between.

See also BuildFullRef() in %iKnow.Source.Lister.

classmethod DefaultProcessor() as %String [ Language = objectscript ]

Default Processor: %iKnow.Source.Temp.Processor

method ExpandList(listparams As %List) as %Status [ Language = objectscript ]

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 [ Language = objectscript ]
Inherited description:

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 [ Language = objectscript ]

Lister alias: "SQL"

private classmethod SplitFullRef(domainId As %Integer, fullRef As %String, Output groupName As %String, Output localRef As %String) as %Status [ Language = objectscript ]

Splits the full reference in group name and ID by finding the last colon, which by definition should separate the local reference (which cannot contain colons) from the group name.

See also SplitFullRef() in %iKnow.Source.Lister.

method TestParams(listerParams...) as %Status [ Language = objectscript ]

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

Inherited Members

Inherited Properties (Including Private)

Inherited Methods (Including Private)

FeedbackOpens in a new window