[Logo] MyDWBI---致力于打造最专业的中文数据仓库,商务智能社区
  [Groups]首页  [Blog] 博客   [Search] 搜索   [Recent Topics] 最新主题   [Hottest Topics] 热门主题   [Hottest Download] 热门下载   [Members]  会员列表  
[Register] 会员注册 / 
[Login] 登入 
Update Strategy 中的DD_DELETE不起作用  XML
论坛首页 » Informatica
前往:   
发表人 内容
daniel-yong
秋离


初级会员

注册时间: 2008-09-16 20:22:57
文章: 5
来自: 东林书院
离线

我从目标表中抽取部分数据,通过UPDATE STRATEGY 删除。运行时一切都正常,但就是不删除数据,难道还有地方要设置?
[MSN]
lynx286
一失足成千古风流人物!


论坛CEO
[Avatar]

注册时间: 2008-04-22 11:52:00
文章: 652
来自: 四海为家
离线

对这种"运行时一切都正常"的错误描述, 我实在不知如何回答是好.
给个例子你回去好好研究吧.

Usage
This mapping template uses an Update Strategy Transformation to flag records for deletion from the target table

Challenge Addressed

When data in a target table is to be deleted, it is necessary to consider various delete strategies and adapt the best strategy for a business scenario. The delete strategy should be efficient, easy to implement, and flexible enough to allow for easy modification of the delete criteria in the future.

Overview

There are many methods of deleting records from a target table. This mapping template illustrates a method of using an Update Strategy transformation in a PowerMart / PowerCenter mapping to flag records that need to be deleted from the target table.

Implementation Guidelines

The mapping has an update strategy transformation just before the target to flag individual rows for deletion. In the Properties tab of the Update Strategy transformation, the 'Update Strategy Expression' property is set to DD_DELETE or the Numeric Value 2, to mark the rows for deletion. Using DD_DELETE makes it easier to debug mappings than using the numeric 2. The following are a few points to keep in mind while using update strategy to delete records:
  • Make sure you select the 'Delete' option in the target properties in a session (This option is selected by default when you create a session).

  • Rows can be deleted from a target table using various methods. For example, you can set the session property 'Treat Rows As' to'Delete' to mark all rows for deletion. But this approach makes it impossible to flag only a few rows for deletion based on a criterion.

  • You can also use a stored procedure to perform the deletion and call the stored procedure from within a PowerMart/PowerCenter mapping instead of using an Update Strategy transformation. However using an Update Strategy transformation will result in better performance over using stored procedures.

  • Use a conditional expression to mark only selected rows for deletion. For example, you can use an expression such as IIF(STORE_ID < 100, DD_DELETE, DD_REJECT) to delete only the rows that have STORE_ID less than 100.

  • If you use an Aggregator transformation after the update strategy transformation, beware of the aggregator behavior. For example, if the row marked for deletion is used in a 'Sum' operation, the aggregator actually subtracts the value appearing in this row.

  • Make sure that the user running this session has privileges to delete records from the target table in the database.

  • Make sure that there are no constraints at the database level on this table that prevents records from being deleted.

  • If you are deleting a large number of rows, then you should check to make sure that the rollback segment is big enough to hold that many rows.

  • If the database does page level locking and your session tries to delete a row from a page that is already locked, the session will fail.


  • Pros

    Flexibility of using a conditional expression.
    Performance gain over a stored procedure for deleting records.

    Cons

    The primary key constraint must exist in the target definition in the repository. If the primary key does not exist in the target table, then you have to create one in the designer so that the mapping has a where clause for the delete query (Note: it is not necessary to create the key in the underlying database).
     文件名称 16315_fm_Delete_Rows_With_Update_Strategy.zip [Disk] 下载
     描述
     文件大小 2 Kbytes
     下载次数:  28 次


    唯大英雄能本色,是真名士自风流.
    [WWW]
    zdcku
    嘉颖


    高级会员
    [Avatar]

    注册时间: 2008-05-06 22:32:12
    文章: 152
    来自: 江苏南京
    离线

    不知道是不是这样的一种情况哦
    好像是个bug(8版本)
    就是一个mapping建立后 并且seeesion也建好后
    在添加UPD组件或者修改UPD组件属性插入为更新删除等
    刷新session是没有反应的 它还是作为insert操作
    两个对策 删除session重建
    或者 简单点
    修改session的某属性Treat source rows as -》data Driven

    这篇文章被编辑了 1 次. 最近一次更新是在 2008-09-18 21:08:13


    学习
    [MSN]
    daniel-yong
    秋离


    初级会员

    注册时间: 2008-09-16 20:22:57
    文章: 5
    来自: 东林书院
    离线

    我也觉得是bug,不管了。我直接用pre-sql写在target里,一样实现
    [MSN]
     
    论坛首页 » Informatica
    前往:   

    网站地图 |  联系我们 |   |  招聘版主 |  免责声明 |  意见建议 |  系统帮助 | 
    Copyright © 2008, mydwbi.com, All Rights Reserved | Powered by JForum 2.1.8 © JForum Team