Search code examples
sqlinformatica-powercenter

How to delete recodrs using sysdate through informatica


I have developed a mapping in informatica.Source is file .I need to write a post sql that will delete the already existing data if the file with same name comes again.File comes once in every month and naming is like jass_naming_yyyymm.csv .I have written like delete from tab where load_date = sysdate but its not working.laod date is a column in target table taht stores yyyymm from the file.So query shoud be like if file with existing yyyymm comes again the existing data should get deleted and new file will be loaded. Please give soluntion.


Solution

  • Post SQL will not help here. You need two pipelines.
    Pipeline 1 - Src->exp->tgt. Use indirect file read method, get file name to fetch yyyy_mm part from file name. You need to use 'update override' option in the target to delete the data. Use this logic -
    DELETE FROM target_table WHERE target_yyyy_mm= :TU.source_yyyy_mm enter image description here Pipeline 2 - your mapping.

    HTH