首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > PowerDesigner >

DD_UPDATE(更新策略组件的一种模式)

2012-10-17 
DD_UPDATE(更新策略组件的一种方式)Flags records for update in an update strategy expression. DD_UPDA

DD_UPDATE(更新策略组件的一种方式)

Flags records for update in an update strategy expression. DD_UPDATE is equivalent to the?

?

integer literal 1.

Note: Use the DD_UPDATE constant in the Update Strategy transformation only. Use DD_UPDATE?

?

instead of the integer literal 1 to facilitate troubleshooting complex numeric expressions.

When you run a workflow, select the data-driven update strategy to write records to a target?

?

based on this flag.

Examples

?

The following examples modify a mapping that calculates sales for the current month. The?

?

mapping loads sales for one employee.

?

This expression flags records for Alex as updates and flags all others for rejection:

IIF( EMPLOYEE.NAME = 'Alex', DD_UPDATE, DD_REJECT )

This expression uses numeric literals to produce the same result, flagging Alex’s sales for?

?

update (1) and flagging all other sales records for rejection (3):

IIF( EMPLOYEE.NAME = 'Alex', 1, 3 )

Notice that the expression using constants is easier to read than the expression using?

?

numeric literals.

The following update strategy expression uses SYSDATE to find only those orders that have?

?

shipped in the last two days and flag them for insertion. Using DATE_DIFF, the expression?

?

subtracts DATE_SHIPPED from the system date, returning the difference between the two dates.?

?

Because DATE_DIFF returns a Double value, the expression uses TRUNC to truncate the?

?

difference. It then compares the result to the integer literal 2. If the result is greater?

?

than 2, the expression flags the records for rejection. If the result is 2 or less, it flags?

?

the records for update. Otherwise, it flags them for rejection:

IIF( TRUNC( DATE_DIFF( SYSDATE, ORDERS.DATE_SHIPPED, 'DD' ), 0 ) > 2, DD_REJECT, DD_UPDATE )

热点排行