DEFINE CUSTOM VIEW

Purpose

Define a custom view as a list of custom view columns.

Syntax

[DEFINE] CUSTOM VIEW <source system name>"."<custom view name> LOCATION <location>
[ "(" <custom view column> [{"," <custom view column>}] ")" ]      
USES "(" <business object>"."<business attribute> [{"," <business object>"."<business attribute>}] ")"
";"
 
<custom view column> = <column name> <type> [IS [NOT] IGNORED] <business definition>
 
<type> = <technical data type> ["(" <precision> ["," <scale> ")"]]
 
<business definition> =
[AS <business name>]
[IS [NOT] INSCRIPTION TIME]
[IS [NOT] KEY]
[IS [NOT] DELETE FLAG]
[ "(" (<business object name> | ( [<business object name> [{"," <business object name>}]] ) ")"]

For an explanation of the syntax notation, see TinML Syntax Notation.

Usage Notes

LOCATION The name of the view created by the user in the schema of the source system on the target database.
IS [NOT] IGNORED Custom view columns that are flagged IS IGNORED will be excluded from the import process.
IS [NOT] INSCRIPTION TIME

Exactly one custom view column must be flagged as inscription time (IS INSCRIPTION TIME). The default is IS NOT INSCRIPTION TIME

IS [NOT] KEY

At least one custom view columns must be flagged as a business key (IS KEY) or not (IS NOT KEY). The default is IS NOT KEY.

IS [NOT] DELETE FLAG At most one custom view column can be flagged as delete flag (IS DELETE FLAG). The default is IS NOT DELETE FLAG.
<business object name>

If business objects are specified in the optional <business definition> clause, business keys and source attributes will be defined and mapped to the custom view column.

A custom view must be mapped to exactly one business object.

USES The list of business attributes used by the custom view. Yotilla will generate input views for each business object of these business attributes.

Custom Views are always loaded with load type DELTA.

Examples

Example 1

// Definition without columns
 
DEFINE CUSTOM VIEW "My System"."Product Discount" LOCATION "PRODUCT_DISCOUNT"
    USES ("Product"."Product Number", "Product"."Net Price")
;

Expected Result

Custom View "My System"."Product Discount" defined.

Example 2

// Definition with columns

DEFINE CUSTOM VIEW "My System"."Product Discount" LOCATION "PRODUCT_DISCOUNT" (
  "product_nr" [VARCHAR] (10) AS "Product Number" IS KEY ("Product"),
  "discount_price" [DECIMAL] (10,2) AS "Discount Price" ("Product"),
  "double_discount_price" [DECIMAL] (10,2) AS "Double Discount Price" ("Product"),
  "last_modifed" [TIMESTAMP] AS "last modified" IS INSCRIPTION TIME ("Product")
)
USES ("Product"."Product Number", "Product"."Net Price")
;

Expected Result

Custom View "My System"."Product Discount" defined.