AUTOGENERATE Clause

Use the AUTOGENERATE clause in an input window to automatically generate values that function as primary keys for input data that does not have a natural primary key.

Note: Do not use the AUTOGENERATE with upserts. This might produce duplicate rows in a window, especially when the automatically-generated column is a primary key.
The example creates a schema named TradeSchema.
CREATE SCHEMA TradeSchema (
    AutoGenId  long,
    Symbol     STRING,
    Price      MONEY (4),
    Volume     INTEGER,
    TradeTime  DATE
);

The example then creates an input window named Trades that uses the schema TradeSchema and sets the AutoGenId as the primary key. Finally, the example uses the AUTOGENERATE clause to automatically generate values for the AutoGenId column.

CREATE INPUT WINDOW Trades
SCHEMA TradeSchema
PRIMARY KEY (AutoGenId)
AUTOGENERATE (AutoGenId);
The example concludes by attaching the XML Input Adapter to the input window named Trades to process the incoming stream data.
ATTACH INPUT ADAPTER xmlInConn1
    TYPE xml_in
    TO Trades
    PROPERTIES
        blockSize=1,
        dir='../exampledata',
        file='Trades.xml',
        filePattern='*.xml',
        safeOps=false,
        skipDels=false;