This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Home > Class Reference > ENSLIB namespace > EnsLib.SQL.InboundAdapter


class EnsLib.SQL.InboundAdapter extends Ens.InboundAdapter, EnsLib.SQL.Common

SQL database polling client adapter. Repeatedly executes a query against a remote database via an ODBC- or JDBC- defined DSN (Data Source Name) and processes each resulting row.

Property Inventory (Including Private)

Method Inventory (Including Private)


parameter SERVICEINPUTCLASS = EnsLib.SQL.Snapshot;
parameter SETTINGS = Query:Data,Parameters:Data,DeleteQuery:Data,KeyFieldName:Data;
These are the production settings for this object

Properties (Including Private)

property %CurrResultSet as EnsLib.SQL.GatewayResultSet [ Private ];
ResultSet carried over to multiple OnTask() calls if multiple rows found
Property methods: %CurrResultSetGet(), %CurrResultSetGetSwizzled(), %CurrResultSetIsValid(), %CurrResultSetNewObject(), %CurrResultSetSet()
property %InstKey as %Integer [ Private ];
Key index for one Adapter instance to Array of RowIDs of rows found in the current execution of its query.
Property methods: %InstKeyDisplayToLogical(), %InstKeyGet(), %InstKeyIsValid(), %InstKeyLogicalToDisplay(), %InstKeyNormalize(), %InstKeySet()
property %LastKey as %Numeric [ Private , InitialExpression = 0 ];
If DeleteQuery is empty or fails, the IDKey value of the last retrieved row is recorded here. If you want to use a Query that will return only new ID values and not use a DeleteQuery, use a Parameters specifier that includes "%LastKey" to access this transient value or "&%LastKey" to access a persistent copy of this value.
Property methods: %LastKeyDisplayToLogical(), %LastKeyGet(), %LastKeyIsValid(), %LastKeyLogicalToDisplay(), %LastKeyNormalize(), %LastKeySet()
property %Row as EnsLib.SQL.Snapshot [ Private ];
A shell to hold the current row to pass to ProcessInput()
Property methods: %RowGet(), %RowGetObject(), %RowGetObjectId(), %RowGetSwizzled(), %RowIsValid(), %RowNewObject(), %RowSet(), %RowSetObject(), %RowSetObjectId(), %RowUnSwizzle()
property DeleteQuery as %String);
If specified, used to delete rows after processing. Must have exactly one parameter for IDKey value
Property methods: DeleteQueryDisplayToLogical(), DeleteQueryGet(), DeleteQueryIsValid(), DeleteQueryLogicalToDisplay(), DeleteQueryLogicalToOdbc(), DeleteQueryNormalize(), DeleteQuerySet()
property KeyFieldName as %String [ InitialExpression = "ID" ];
The name of the IDKey field in the query's resultset. Must be unique (non-reused) over time if DeleteQuery is empty.
Property methods: KeyFieldNameDisplayToLogical(), KeyFieldNameGet(), KeyFieldNameIsValid(), KeyFieldNameLogicalToDisplay(), KeyFieldNameLogicalToOdbc(), KeyFieldNameNormalize(), KeyFieldNameSet()
property Parameters as %String (MAXLEN = 1000);
A comma-separated list of parameter value specifiers, if any. These correspond to any replaceable ? parameters in the query string. % refers to Adapter properties such as %LastKey; $ refers to Service class properties; & refers to persistent values saved between invocations.
Property methods: ParametersDisplayToLogical(), ParametersGet(), ParametersIsValid(), ParametersLogicalToDisplay(), ParametersLogicalToOdbc(), ParametersNormalize(), ParametersSet()
property Query as %String) [ Required ];
The Base query string that will be repeatedly executed to look for new rows
Property methods: QueryDisplayToLogical(), QueryGet(), QueryIsValid(), QueryLogicalToDisplay(), QueryLogicalToOdbc(), QueryNormalize(), QuerySet()

Methods (Including Private)

classmethod GetPersistentValue(pConfigName As %String, pParamName As %String) as %String
classmethod InitializeLastKeyValue(pConfigName As %String, pNewLastKey As %String = 0) as %String
classmethod InitializePersistentValue(pConfigName As %String, pParamName As %String = "%LastKey", pNewValue As %String) as %String
Set persistent value (default name=%LastKey) to new value only if it is currently undefined. Return old value if any.
method OnInit() as %Status
Inherited description: This user callback method is called just after %OnNew()
method OnTask() as %Status
Inherited description: default InboundAdapter behavior: always call ProcessInput on CallInterval
method OnTearDown() as %Status
Inherited description: This user callback method is called just before %OnClose()
classmethod SetPersistentValue(pConfigName As %String, pParamName As %String, pValue As %String) as %String
private method getParms(Output pArray) as %Status
Parse out parameters by comma-separators, honoring single and double quotes, escaped by doubling

Inherited Members

Inherited Properties (Including Private)

Inherited Methods (Including Private)

FeedbackOpens in a new window