Informatica: Write data into multiple files based on State name

ぐ巨炮叔叔 提交于 2019-12-08 07:32:56

问题


I have table with a column called State. My requirement is to read data from the table and write it into multiple files based on State name. I'm using Informatica PowerCenter as ETL tool


回答1:


Create a mapping as below:

Source --> SQ (sort data state name)--> Expression --> Transaction Control --> Target

Expression: Create a variable port to store previous value of state and a output port flag.

flag = IIF(state = var_state,0,1)
var_state = state

In Transaction Control Transformation, use TC_COMMIT_BEFORE when Flag = 1

Add Filename port to Target and map state name as filename.




回答2:


You can also do this using post shell command:

Output file --> Name of output file of Informatica.
$2 --> assume 2nd field is the statement. Replace it as per your file

    awk -F\| '{print>$2}' outputfile


来源:https://stackoverflow.com/questions/50087907/informatica-write-data-into-multiple-files-based-on-state-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!