santosh kumar sarangi


{ City } hyderabad
< Country > india
* Profession * software developer
User No # 100138
Total Questions Posted # 0
Total Answers Posted # 12

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 30
Users Marked my Answers as Wrong # 5
Questions / { santosh kumar sarangi }
Questions Answers Category Views Company eMail




Answers / { santosh kumar sarangi }

Question { 14950 }

IS IT POSSIBLE THAT THERE R TWO PRIMARY KEY WILL BE IN A
SAME TABLE?PLZ HELP ME BY GIVING THE ANSWER.THANK U.


Answer

Hi Tdguy, can you please tell me the syntax to create more
than one primary key for a single table.

Is This Answer Correct ?    0 Yes 0 No

Question { HCL, 10804 }

In seqence generator transformation maximum limit is
reached,after reaching maximum limit how will u insert the
data


Answer

If sequence generator reached the maximum limit and can't
increase then do as follows.

1. Reset sequence generator to 0
2. Add a expression transformation make an out put port
Out_put_port= max_val_previous_sequence_gen+new_current_val

In this case you can generate next max value.

Let me know if any things wrong.

Thanks $ Regards
Santosh Kumar Sarangi

Is This Answer Correct ?    4 Yes 0 No


Question { Wipro, 12491 }

Hello Everyone,i have one question on sequence generator.i
have two targets and the records comes from the source will
place in the targets like 1-10 rec in target1 and 11-20 rec
in target2,21-30 rec in target1...etc so any one can help
me? plz..Thanq in adv.


Answer

It will work without making sequence generator cyclic

select mod(floor(3/10),2) from dual;

Ans: 0


select mod(floor(12/10),2) from dual;

Ans: 1

select mod(floor(25/10),2) from dual;

Ans: 0

select mod(floor(35/10),2) from dual;

Ans: 1

Thanks,
Santosh.

Is This Answer Correct ?    0 Yes 0 No

Question { Wipro, 12491 }

Hello Everyone,i have one question on sequence generator.i
have two targets and the records comes from the source will
place in the targets like 1-10 rec in target1 and 11-20 rec
in target2,21-30 rec in target1...etc so any one can help
me? plz..Thanq in adv.


Answer

1.Take a sequence generator and connect it to the expression
t/r.
2.In expression transformation create a out put post and
keep the below condition;
VAL_OUT = iif(mod(floor((nextval-1)/10),2)=0,0,1)
3.Keep a router t/r, and filter with the condition VAL_OUT=0
then first target and if VAL_OUT=1 then second target.

Let me know if any thing wrong.

Thanks & Regads
Santosh Kumar Sarangi

Is This Answer Correct ?    0 Yes 0 No

Question { Polaris, 7730 }

my source like dis

10,asd,2000
10,asd,2000
10,asd,2000
20,dsf,3000
20,dsf,3000
20,dsf,3000
like dis and my requirement is first record is inserted into
first target and duplicates of first record is inserted into
second target ...like dis way ...?

how to achieve dis?


Answer

1.first sort the data with sorter t/r as ID key column and
create below port in exp transformation
var2= var1
id
var1=id
rec_count=iff(var1=var2,rec_count+1,1)
2.Give all the port to router t/r and give the filer
condition as below
rec_count=1 then to first target
default to 2nd target

Let me know if any things is wrong.

Thanks & Regards
Santosh Kumar Sarangi

Is This Answer Correct ?    1 Yes 0 No

Question { IBM, 6333 }

Hi,
In source I have records like this
No name address
10 manoj mum
10 manoj dilhi
20 kumar usa
20 kumar Tokyo
I want records in target like shown below
No name addr1 addr2
10 manoj mum dilhi
20 kumar usa Tokyo

If it is reverse we can do this by using Normalizer
transformation by setting occurance as 2.
Somebody will say use denoralization technique. But as of my
knowledge I couldn’t find any denormalization technique. Is
there any concept like that?
I tryid this seriously but I could find any idea to
implement this.
Can any one please help me ?
Advance Thanks


Answer

select no, name, max(decode(ronum,1,address1)) as address1,
max(decode(ronum,2,address1)) as address2 from (select
no,name,address1,row_number() over(partition by no order by
no) as ronum from model16) group by no, name

Is This Answer Correct ?    1 Yes 0 No

Question { TCS, 7039 }

we have 20 records in source system, when we run for the 1st
time, it should load only 10 records into the target, when
you run for the second time it should load another 10 record
which are not loaded. How do we do that? Can we write a SQL
query in source qualifier to do it. This q' is asked in one
f the interviews. Please let me know if anyone knows. Thanks


Answer

1. Create a mapping variable $$SESSION.
2. Link from SQ to Router t/r.
3. Create two group
a. SETMAXVARIABLE($$SESSION,$$SESSION+1) % 2 = 1
b. SETMAXVARIABLE($$SESSION,$$SESSION+1) % 2 = 0
4. Link both group to two filter and create two Sequence geneter and check the reset option.
5. Link the sequence generator to filter t/r.
6. Keep the condition as "NEXTVAL<=10" for first filter.
7. Keep the condition as "NEXTVAL>10" for second filter.
8. Link the two filter to two different target instance.

Let me know if any things wrong.

Thanks & Regards
Santosh Kumar Sarangi

Is This Answer Correct ?    1 Yes 1 No

Question { Thomson Reuters, 10008 }

i have 1000 records in my dource table, the same i have in
target ,but a new column added in target as "batchno", and
this column adds no 10 for 1st 100 records and 20 for next
100 records and 30 next 100 records and vice versa. how to
acheive this?


Answer

Please follow the below step.

1.Create sequence geneteor which will start with 1.
2.Connect the nextval port to expression t/p.
3.connect port from sq transformation to expression t/p.
4.Create below port in the expression transformation.
a. NEXTVAL_OUT(Variable port)= NEXTVAL-1
b.rec_con(Variable port)= IIF(NEXTVAL_OUT % 100 = 0, REC_CON+10,REC_CON)
c. REC_CON_OUT(Out put port)= rec_con

5. If you have primary key on the target table then use update startegy t/r to update the targer.
6. If you don't have primary key on the target table then use update voerride in the properties tab of the target.
7. U can use the below query to update the target by update override.
UPDATE EMP_UPDATE SET REC_COUNT = :TU.REC_COUNT WHERE EMPID = :TU.EMPID

Please correct me if anything wrong.

Thanks and Regards
Santosh Kumar Sarangi

Is This Answer Correct ?    1 Yes 1 No

Question { TCS, 13518 }

HOW TO DELETE A RECORD FROM FLAT FILE


Answer

1.If you have duplicate data then you can use sorter or aggregator transformation to remove duplicate.
2. If u want to delete record after 50 the row then u can use sequence genetor.
3. Write the result to a other flat file as target.
4. Use 'Post session success command' in component tab of session task to delete the old flat file and rename the target flat file to old flat file.

Please correct me if this is wrong
Thanks and regards
Santosh Kumar Sarangi

Is This Answer Correct ?    2 Yes 1 No

Question { Amdocs, 5769 }

My source is like bellow
F.NAME M.NAME L.NAME
A B C
D E F
G H I

and out put should like

S.NO F.NAME M.NAME L.NAME
1 A B C
2 D E F
3 G H I
4 UNNOWN UNNOWN UNNOWN

How can we acheive? please explane me indetail


Answer

if target is a database the you can write post sql in session to the result as below

insert into table_name values((select max(s.no)+1 from table_name),'UNKNOWN','UNKNOWN',UNKNOWN);

Is This Answer Correct ?    2 Yes 0 No

Question { IBM, 7020 }

Hi frnds...can any one help me regarding this que..

We have column in a table name it as C1 WHICH CONTAIN
ALPHANUMERIC AND NUMERIC VALUES.

C1
2A
2B
2V
2H
1
2
3
4
5

i want to retrive numeric values like 1,2,3,4,5

How we can get

Plz let me know.Thanks in advance


Answer

Hi Friends some addition to 'Chelvam' ans.

SELECT C1 FROM WHERE UPPER(C1) =
C1(CASESPECIFIC) AND LOWER(C1) = C1(CASESPECIFIC)

Is This Answer Correct ?    5 Yes 0 No

Question { Cap Gemini, 8579 }

My source data like...

Empid Name
10 chandra
10 sekhar

I am expecting result is

Empid Ename
10 Chandrasekhar

How can we solve this prob?


Answer

Follow the below step.
1.Take the sorter transformation and sort by empid(IF some cases empid not in sequence).
2.Take a expression transformation with below condition.
a. CURRENT_ID=EMPID
b. EMPID=EMPID
C. name=name
d. NAME_VAR= IIF(CURRENT_ID = NEXT_ID,(NAME_VAR ||name ),name)
e.NAME_OUT= NAME_VAR
f. NEXT_ID= CURRENT_ID
3.Take a aggregator transformation and give group by port as empid.

Is This Answer Correct ?    13 Yes 2 No