Scenario:
Source data looks like below
Target 1 (Event number of
occurrences)
A has come 2 times in the source, it should go to Target 1
Target 2 (odd number of occurrences)
If source data repeats odd number of times then it should go to
Target 2
Solution:
create table test_odd_even_src
(
col1 varchar2(3)
);
create table test_odd_tgt
(
col1 varchar2(3),
col2 int
);
create table test_even_tgt
(
col1 varchar2(3),
col2 int
)
;
insert into test_odd_even_src values('A');
insert into test_odd_even_src values('A');
insert into test_odd_even_src values('B');
insert into test_odd_even_src values('B');
insert into test_odd_even_src values('B');
insert into test_odd_even_src values('C');
insert into test_odd_even_src values('D');
Mapping Looks like this:
Aggregator Transformation:
Joiner:
Router Transformation:
Now try to insert 2 more records into source and run the session again (Before that truncate target tables)
insert into test_odd_even_src values('A');
insert into test_odd_even_src values('B');
Source Data
after inserting 2 new records.
select * from test_even_tgt
select * from test_odd_tgt
SQL Scenario:
Source
id,color
a1,yellow
a2,unknown
a1,green
a3,unknown
a1,unknown
a2,blue
id,color
a1,yellow
a2,unknown
a1,green
a3,unknown
a1,unknown
a2,blue
Target
id,color
a1,yellow
a1,green
a3,unknown
a2,blue
id,color
a1,yellow
a1,green
a3,unknown
a2,blue
Data Preparation:
create table test_color_src
(
id varchar2(30),
color varchar2(30)
);
create table test_color_tgt
(
id varchar2(30),
color varchar2(30)
);
insert into test_color_src values('a1','yellow');
insert into test_color_src values('a2','unknown');
insert into test_color_src values('a1','green');
insert into test_color_src values('a3','unknown');
insert into test_color_src values('a1','unknown');
insert into test_color_src values('a2','blue');
Solution:
Source Data:
SQL Query and Its output:
select id,color from test_color_src where color <> 'unknown'
union
(select id,'unknown' from test_color_src where color = 'unknown'
MINUS
select id,'unknown' from test_color_src where color <> 'unknown'
)
Great articles, first of all Thanks for writing such lovely Post! Earlier I thought that posts are the only most important thing on any blog. But here a Shout me loud found how important other elements are for your blog.Keep update more posts..
ReplyDeleteEmail Marketing Chennai
your blog is really awesome and you have clearly explained many more topics and it is really good thus it is very much interesting and really nice too.
ReplyDeleteBest Informatica Training Institute in Chennai
I just see the post i am so happy the post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be subscribing to your feed and I hope you post again soon.
ReplyDeletedigital marketing company in chennai
seo company in chennai
Simply superb article thank you
ReplyDeleteYour thinking toward the respective issue is awesome also the idea behind the blog is very interesting which would bring a new evolution in respective field. Keep update more information.
ReplyDeleteInformatica Training in Chennai
This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic. iOS App Development Company in India
ReplyDeleteThis blog is having the general information. Got a creative work and this is very different one.We have to develop our creativity mind.This blog helps for this. Thank you for this blog. This is very interesting and useful. Security alarm in Chennai
ReplyDelete
ReplyDeleteThat is very interesting; you are a very skilled blogger. I have shared your website in my social networks..!
Payday loans in Alabama
Title loans in South Carolina
Thanks for spending your valuable time in delivering the most valuable content here.I loved the way you write and suggest my friends too for getting aware of your blogs.
ReplyDeletePawn Shops in Montgomery
Pawn Shops in Birmingham
Pawn Shops in Mobile
This idea is mind blowing. I think everyone should know such information like you have described on this post. Thank you for sharing this explanation.Your final conclusion was good. We are sowing seeds and need to be patiently wait till it blossoms.
ReplyDeletePsoriasis Shampoo
Best Anti Dandruff Shampoo
Psoriasis Scalp Treatment
Dandruff Shampoo
This blog is having the good information. Got a creative work and this is very different one.We have to develop our creativity mind.This blog helps for this.Thank you for this blog.This is very interesting and useful.
ReplyDeleteSelf Employment Tax
Tax Preparation Services
Tax Accountant
Tax Consultant
Tax Advisor
This comment has been removed by the author.
ReplyDeleteGreat Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
ReplyDeleterpa training in bangalore
best rpa training in bangalore
RPA training in bangalore
RPA courses in bangalore
Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
ReplyDeleteAWS Training in Bangalore with Placements | AWS Training in Bangalore Cost
AWS Training in Pune With Placement | AWS Devops Training in Pune
AWS Online Training | AWS Online Training Cost
AWS Training in Bangalore cost| Aws training in Bangalore Besant Technologies
Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.
ReplyDeleteAWS Training in Bangalore
I think there is a need to look for some more crucial and important aspects of Informatica and SQL.
ReplyDeleteInformatica Read JSON
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.
ReplyDeleteSoftware Testing Services
Functional Testing Services
Test Automation Services
QA Automation Testing Services
Regression Testing Services
API Testing Services
Compatibility Testing Services
Performance Testing Services
Security Testing Services
Software Testing Company
Software Testing Services in USA
Software Testing Companies in USA
So far out of all the blogs,I personally feel this blog is just awesome.There are soo many information provided here in this blog. Therefore It is totally amazing...
ReplyDeleteSoftware Testing Services
Software Testing Services in India
Software Testing Companies in India
Software Testing Services in USA
Software Testing Companies in USA
Software Testing Companies
Software Testing Services Company
QA Testing Services
perde modelleri
ReplyDeleteMobil Onay
mobil ödeme bozdurma
nft nasıl alınır
Ankara evden eve nakliyat
Trafik sigortası
DEDEKTOR
web sitesi kurma
AŞK KİTAPLARI