ATTACH ADAPTER Statement

Attach an adapter to a stream or window.

Syntax

ATTACH { INPUT|OUTPUT } ADAPTER name 
TYPE type 
TO streamorwindow
[GROUP groupName]
[PROPERTIES {prop=value} [, ...]];

Parameters

name Name of the adapter
type Specifies the type of the adapter
streamorwindow Specifies the stream or window to which you are attaching the adapter

Usage

Adapters are defined with an inline definition of the type and the properties that make up the adapter or else via an adapter property set. The type is the unique ID assigned to each adapter. You can find each adapter's type in the Adapters Guide.

An ATTACH ADAPTER statement cannot appear after an ADAPTER START statement.

There is no statement that creates adapter groups. You can group adapters by providing the groupname in the GROUP clause. This grouping is then later used in the ADAPTER START statement to start the adapters in the prescribed order. You cannot specify a group without an ADAPTER START statement.

An adapter marked as input can be attached only to an input stream or window. An adapter marked as output can be attached to an input or output stream or window. An adapter (either input or output) cannot be attached to a local stream or window. An adapter defined as an input adapter in its cnxml file cannot be attached as an output adapter, and an adapter defined in its cnxml file as an output adapter cannot be attached as an input adapter.

The property name and value pairs that are valid for an ATTACH ADAPTER statement are dependent on the adapter type. The property names are case-insensitive. All specifications relating to what properties are required by a particular adapter exist in that adapter's cnxml file, which is stored in the SAP Sybase Event Stream Processor installation folder. This file is used in the validation of properties.

Any adapter property you provide must have its name defined in the adapter's cnxml file, and the values for all properties must match their defined datatypes. If the same property is provided twice, the compiler raises an error.

You can also specify property sets within an ATTACH ADAPTER statement. Property sets are reusable sets of properties that are stored in the project configuration file. If you specify a property set, verify that all required properties are set as individual properties. Property sets override individual properties specified within the ATTACH ADAPTER statement.

Example

ATTACH INPUT ADAPTER MacysInventory
TYPE dsv_in
TO InventoryInfo
PROPERTIES
dir='C:/Operations/Stock/Inventory/MacysInventory',
file='inventory.csv',
propertyset='<name>';