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 )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值