kamlesh mishra


{ City } bangalore
< Country > india
* Profession * software developer
User No # 113240
Total Questions Posted # 1
Total Answers Posted # 13

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

Users Marked my Answers as Correct # 6
Users Marked my Answers as Wrong # 3
Questions / { kamlesh mishra }
Questions Answers Category Views Company eMail

src name sex a,male b,female c,male d,female Required output : male female a,b c,d tried pivot but was not successfull select * from src pivot (max(name) for sex in ('MALE','FEMALE'));

IBM,

Oracle General 1171




Answers / { kamlesh mishra }

Question { Target, 25610 }

how to run 2 workflows sequentially. plz respond what is the
process?


Answer

to execute workflows in sequence we can use file watch mechanism
in first worklet create a touch file after successful run and in second worklet use event wait (file watch mechanism) looking for a file at a particular location.

Is This Answer Correct ?    2 Yes 0 No

Question { IBM, 16977 }

Hi,

I have one scenario.. i want to insert 4 times (Duplicate)
a row in the target. Please help me .

source row: abcabc


Tgt table:

abcabc
abcabc
abcabc
abcabc


Answer

After sQ use a java transformation with this logic
for (int i=0;i<4;i++)
{
o_col= (input col that have the value);
generateRow();
}

Is This Answer Correct ?    2 Yes 0 No


Question { Wipro, 16047 }

my source having 10 records but how can i load 20 records in
target, i am not bother about duplicates?


Answer

After SQ use Java transformation

SQ--Java transformation

for(int i=0;i<2;i++)
{
output_port=input_port;
generateRow();
}

Is This Answer Correct ?    0 Yes 0 No

Question { IBM, 15089 }

if i am having 10 records in source, i want 20 records in
target...how will you do it


Answer

user following code in java transformation
for( int i=0;i<2;i++)
{
output_port 1=input port 1;
output_port n=input port n;
generateRow();
}

Is This Answer Correct ?    1 Yes 0 No

Question { IBM, 8554 }

hi all hi have flat file like below my requirement is
empid,ename,sal,loc
101,vamshi,5000,hyd
101,vamshi,5020,hyd
201,raju,5000,hyd
202,ram,4000,hyd
203,kumar,3500,pune
203,kumar,3500,pune
203,kumar,5000,hyd
203,kumar,6000,hyd
i want the o/p like this
in one target
201,raju,5000,hyd
202,ram,4000,hyd
and in second target
101,vamshi,5000,hyd
101,vamshi,5020,hyd
203,kumar,3500,pune
203,kumar,3500,pune
203,kumar,5000,hyd
203,kumar,6000,hyd


Answer

After SQ Take Aggr group by empid and create a variable port Rows_count=count(1)
Take a router after aggr and create two groups one for uniqe and one for duplicate
in uniqe condition = Rows_count=1
duplicate group condition= Rows_count>1
connect unique group to tgt1
connect duplicate group to java transformation---
add following codes
for (int i=0;i {
o_empid=i_empid;
o_ename=i_ename;
o_loc=i_loc;
o_sal=i_sal;
generateRow();
}

connect java transformation to tgt2

Is This Answer Correct ?    0 Yes 0 No

Question { HP, 9671 }

Converting Rows to columns
I have Relational source like his.
JAN FEB MAR APR
100 200 300 400
500 600 700 800
900 100 200 300

I need to convert these rows into columns to the targe.

MONTH TOTAL
JAN 1500
FEB 900
MAR 1200
APR 1500

Please experts help me


Answer

SQ->EXP->NRM->TGT

EXP :-- CREATE 4 OUTPUT PORTS
PORT1= 'JAN'
PORT2='FEB'
PORT3='MAR'
PORT4='APRIL'
AGGR :-- DRAG ALL PORTS FROM EXP AND CREATE 4 OUTPUT PORT
PORT5= SUM(JAN)
PORT6=SUM(FEB)
PORT7=SUM(MAR)
PORT8=SUM(APRIL)
NRM : CREATE 2 PORTS
MONTHS- OCCUR(4)- STRING
TOTAL- OCCUR(4)- NUMBER
CONNECT NRM OUTPUT PORT TO TGT

Is This Answer Correct ?    0 Yes 0 No

Question { Wipro, 2873 }

I have a text file name x
With a text message. Word informatica
Is repeated for n number of times.
How to count the number of occurrence
Of word informatica

Of word informatic in this file x.


Answer

After SQ take exp trans
exp :
V_COUNT=V_COUNT+1
O_COUNT=V_COUNT
Aggr trans :
COUNT(O_COUNT)

Is This Answer Correct ?    0 Yes 2 No

Question { TCS, 7798 }

write a query following source
region sales
1 1000
2 2000
i want the output ?please give solution
1 2
1000 2000


Answer

SELECT * FROM TABLE_NAME PIVOT( MAX(SALES) FOR REGION IN (1,2));

Is This Answer Correct ?    0 Yes 0 No

Question { 6549 }

i have a source with 100 records.i have 2 targets.in the first
target i want to load first 50 records & in the second target
i want to load next 50(or remaining) records.


Answer

After SQ take expression and add port
v_Sequene=v_Sequence+1
o_Sequence=v_Sequence
Take Router Transformation and add two groups
Group1 = o_sequence<=50
Group2=o_sequence>50
Connect Group1 and Group2 to Target1 and Target2

Is This Answer Correct ?    0 Yes 0 No

Question { 6280 }

write sql query following table
amount year quarter
1000 2003 first
2000 2003 second
3000 2003 third
4000 2003 fourth
5000 2004 first
6000 2004 second
7000 2004 third
8000 2004 fourth

i want the output
year q1_amount q2_amount q3_amount q4_amount
2003 1000 2000 3000 4000
2004 5000 6000 7000 8000

can anybady help me to achieve the aboue result by using informatica.

thanks in advance.


Answer

SQL OVERRIDE :
SELECT * FROM TABLE_NAME PIVOT(MAX(AMOUNT) FOR QUARTER IN ('FIRST','SECOND','THIRD','FOURTH'));

Is This Answer Correct ?    0 Yes 0 No

Question { IBM, 11754 }

I have one source table and three target tables.
When the session runs for the first time involving the
mapping,i want that the loading should take place in 1st
Target table only.
The 2nd time the same session runs the loading should take
place in 2nd Target only only
and similarly when the session runs for the 3rd time loading
should take place in Third only.
And again when the session runs for the 4th time loading
should take place in 1st Target table.


Answer

Create a mapping variable $$INCR=1

Take Expression Transformation after SQ
In Expression Transformation create a variable port:
v_count_session=IIF($$INCR=4,setVariable($$INCR,1),setVarialbe($$INCR,$$INCR+1))

After Exp take a ROUTER Transformation and create three groups with conditions :
GROUP1
$$INCR=1
GROUP2
$$INCR=2
GROUP3
$$INCR=3

Finally connect groups to group1--tgt1, group2--tgt2, group3=tgt3

Is This Answer Correct ?    0 Yes 1 No

Question { Quintiles, 3742 }

I have 2records in target table and this record is deleted in source. Now if I run mapping twice how many records do target will have,  source having 10records. Same with incrementally.  Please  answer me ASAP. 


Answer

what i understand is when first time run source have two records and it got inserted in target and then source data was deleted and new 10 records were inserted . In this case when you run wf again it will insert 10 records to target then , totally we will have 12 records in target

Is This Answer Correct ?    1 Yes 0 No

Question { HCL, 5497 }

i have a source table and 3 target table.
when session runs first time-1st tgt
second time-2nd tgt
third time-3rd tgt
fourth time-again 1st target. so no


Answer

Take a mapping variable of count type $$INCR=1
After SQ take expression and add a variable port
v_INCR_VARIABLE= IIF($$INCR=3,SETVARIABLE($$INCR,0)+1)
Take router and add three groups
Group1-> $$INCR=1
Group2-> $$INCR=2
Group3-> $$INCR=3
Add groups to respective targets.

Is This Answer Correct ?    0 Yes 0 No