Jul 18, 2011

Need count of a character that how many times it repeat

Oracle:
select regexp_count('SRILANKA','A',1,'c') cnt from dual.
Informatica:
SRC-->SQ-->EXP-->TGT

In expression create two variable ports
in_NAME
v_REPLACE_A_CNT=LENGTH(REPLACECHR(0,NAME,'A',''))
v_NAME_CNT=LENGTH(NAME)
out_CNT=v_NAME_CNT-v_REPLACE_A

Target:
connect out_CNT to target port

If you pass 'SRILANKA' as NAME then out put is 2.

No comments:

Post a Comment