Incremental Refresh Directive
This directive defines how a dataset refreshes with the UPDATEABLE table type, using the last updated date (LUD) from the source table.
The incremental refresh directive identifies the incremental input for changes and is crucial for optimizing refresh efficiency in multi-input datasets.
Syntax:
incremental_refresh_directive ::= REFRESH ON {CHANGES|UPSERTS|DELETES} IN table_reference_list ;
table_reference_list ::= '[' table_reference [, <table_reference]… ']'
table_reference ::= table_name | table_alias
The incremental refresh directives are as follows:
- CHANGES: Supports both upserts (updates) and deletes.
- UPSERTS: Supports only upserts (updates); no deletes.
- DELETES: Supports only deletes.
Example:
IMPORT SOURCE SALES
IMPORT SOURCE PRODUCTS
DEFINE UPDATEABLE DATASET SALES_FACT_OJ
ROWSOURCE SALES INNER JOIN PRODUCTS ON SALES.PROD_ID = PRODUCTS.PROD_ID;
THIS = SALES;
THIS[PROD_NAME] = PRODUCTS.PROD_NAME;
PRIMARYKEY [CUST_ID,PROD_ID,PROMO_ID,CHANNEL_ID,TIME_ID];
REFRESH ON CHANGES IN [SALES];
END
See Incremental.