how can we load first and last record from a flat file
source to target?

Answers were Sorted based on User's Feedback



how can we load first and last record from a flat file source to target?..

Answer / srinu

I have an IDEA,
After sql Trans,go with AGG,RANK transformation,
in RankTrans Properties set the rank 1 only---1 row returns,
In AggTrans Dont do any column for Group--Last row returns,
We need 2 Target tables. 1 for 1st record,2 for last record,
if u using the UNIONtrans one Target table is enough,,,
i think it wii help u,,,,,,srinu,,,,,,,,,

Is This Answer Correct ?    13 Yes 4 No

how can we load first and last record from a flat file source to target?..

Answer / hardeep

We can use below configurations to achieve desired output. We need 1 SQ, 1 SGen, 2 Rank and 2 Trgt Defn(same Trt). I think it will be cheaper.

Src-SQualifier-->
|
Rank1(Top 1st) -->Trgt1
--->
Rank2(Bottom 1st) -->Trgt2
|
SGen(NEXTVAL)-->

Is This Answer Correct ?    14 Yes 5 No

how can we load first and last record from a flat file source to target?..

Answer / hina

Below transformation would work: Add the Nextval port of the sequence generator to both the Rank Transformations. In rank transformation select Top and Bottom resp.
------ Rank Transformation (Top)----Tgt(Ins1)
|
SQ---Sequence Generator-----
|
-------Rank Transformation(Bottom)-Tgt(Ins2)

Is This Answer Correct ?    0 Yes 0 No

how can we load first and last record from a flat file source to target?..

Answer / vinod saini

After sql Trans use AGG,JOINER transformation,and use FIRST
& LAST function in AGG transformation without any group.
FIRST & LAST return the first & Last record values. give
JOINER condition based on first & last.

Is This Answer Correct ?    4 Yes 5 No

how can we load first and last record from a flat file source to target?..

Answer / srinu

Hi,,, Vinod, As per your Solution we have to check
complete data Table for ,,

syntax for 1st,last:::

FIRST( ITEM_NAME, ITEM_PRICE > 40 )

FLOOR( PRICE )

ok,,,
Any corrections Let me Know,,,
srinu.srinuvas@gmail.com

Is This Answer Correct ?    1 Yes 5 No

how can we load first and last record from a flat file source to target?..

Answer / sudhar

Alternatively we can use the unix pre session command to
read the 1st and last record from the file and place it in
another file and use that new file as source to load the
target table.

Is This Answer Correct ?    1 Yes 6 No

how can we load first and last record from a flat file source to target?..

Answer / dharmendra

SRC QF -> SEQ -> EXP -> AGR -> RTR -> TGT
create a port in expression t/r and generate a value for
each row using SEQ genrator, then in Agr take count of all
th record.create 2 condition in in router one with SEQ = 1
and another with SEQ = count of rows (this will give last
row).connect both to target.dont forget to give reset
option in SEQ generator.

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More Informatica Interview Questions

What is union transformation?

0 Answers  


Source-1 No name 1 satish 2 karthik 3 swathi 4 keerthi Source-2 No name 1 satish 2 karthik 5 santhose 6 vasu Target 3 swathi 4 keerthi 5 santhose 6 vasu here i want non matching Records i want how to achieve that

5 Answers   TCS,


How can we reset Sequence Generator, when we move objects from Dev Environment to QA env?

2 Answers   Rolta,


How to delete duplicate record in Informatica?

7 Answers  


Normalizer transformation is not involved in Mapplet.. why???

1 Answers   Wipro,






What do think which one is the better joiner or look up?

0 Answers  


what are objects in data warehouse?

2 Answers   Mind Tree,


How will restrict values in 0-9 and A-Z and a-z and special character.Only allowed these chars otherwise we will reject the records? what is the function we used to restrict...

1 Answers   Cap Gemini,


can we use self join in informaitca?

3 Answers   IBM,


what is the function of 'F10' informatica ?

4 Answers   IBM,


Why use shortcuts(Instead of making copies).

1 Answers  


How to load the name of the current processing flat file along with the data into the target using informatica mapping?

0 Answers   Informatica,


Categories