we hava more than 1000 records. i have to select first 5
record, last 5 record and 5 records from middle of the source.
how can i do in oracle as well as in informetica??
Answers were Sorted based on User's Feedback
Answer / babu
Hi All,
ORACLE:
========
Below SQL query will give the exact result of what you
people are expecting.
SELECT rownum num,e.* From Emp e Where Rownum<=5
Union
SELECT * From
(SELECT Rownum Num,E.* From Emp E)
Where Num BETWEEN (SELECT round(Count(*)/2) From Emp)AND
(SELECT round(Count(*)/2) +1 From Emp)
Union
SELECT * From
(SELECT rownum num,e.* From emp e)
Where Num <=(SELECT count(*) From Emp)
And
Num>(SELECT count(*)-5 From Emp)
INFORMATICA:
============
please find the below mapping for your scenario.
SRC==>SQ==>(1)EXP==>AGG=====JNR===>RTR==T1,T2,T3
|| ||
(2)EXP==========
1> In first expression having the all columns coming from
the source and two extra columns(output ports)
I.one for sequence numbers.
II.second one is for constant value
2> In aggregatation transformation count the number of
records based(GROUP BY)on the dummy port.
3> In joiner transformation join the two flows(AGG and Exp
the join column is dummy port)
4> create 3 groups in Router transformation for 1St 5
records,Latst 5 records and Middle 5 records
GRP1::sno<=5
GRP2::sno<=cno+2 and sno>=cno-2 /*cno=count(*)*/
GRP3::sno<=cno and sno>cno-5
Cheers,
Babu rao
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / babu
Hi Guys,
small change is there in above solution
i.e:: GRP2:sno<=(cno/2)+2 AND sno>=(cno/2)-2
Cheers,
Babu Rao
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / chanukya
have the sequence generator transformation in the mapping
whcih will give you the row numbers.
From there you can take watever rows you want. From 1 to
last or anything.
This wil help you.
| Is This Answer Correct ? | 2 Yes | 5 No |
Answer / akash
For implementation through Oracle:
Sort ASC/DESC on rowid in a sub-query and take first 5 rows
of this query in main query.
For implementation through informatica:
1. Use Rank Transformation.
2. Use Sorter Transformation.
The above are for first or last 5 records. Middle 5 records
are not included here.
| Is This Answer Correct ? | 0 Yes | 3 No |
what is granularity in Data ware House?
what happens if the info.server doesn't find the session parameter in the parameter file?
my name is amar i want display 1st line A 2nd line M 3rd line A 4th line R in database & informatica
1. if lookup tr is giving poor performamence. what u do. 2. i have emp,dept table. i want output ename,empno,dname,max(sal). 3. can any one tell me project flow in real time scenario. please send me mail any queries and answers my mail id is yaparala@gmail.com
what is the use of server?
how do u implement configuration management in Informatica?
5. How many repositories can we create in Informatica? 6. What is surrogate key? 7. What is difference between Mapplet and reusable transformation? 8. What is aggregate awareness? 9. Explain reference cursor? 10. What are parallel querys and query hints? 11. DWH architecture? 12. What are cursors? 13. Advantages of de normalized data? 14. What is operational data source (ODS)? 15. What is meta data and system catalog? 16. What is factless fact schema? 17. What is confirmed dimension? 18. What is the capacity of power cube? 19. Difference between PowerPlay transformer and power play reports? 20. What is IQD file? 21. What is Cognos script editor? 22. What is difference macros and prompts? 23. What is power play plug in? 24. Which kind of index is preferred in DWH? 25. What is hash partition? 26. What is DTM session? 27. How can you define a transformation? What are different types of transformations in Informatica? 28. What is mapplet? 29. What is query panel? 30. What is a look up function? What is default transformation for the look up function? 31. What is difference between a connected look up and unconnected look up? 32. What is staging area? 33. What is data merging, data cleansing and sampling? 34. What is up date strategy and what are th options for update strategy? 35. OLAP architecture? 36. What is subject area? 37. Why do we use DSS database for OLAP tools?
State the differences between shortcut and reusable transformation
What are the various tools used in etl?
what are the reporting tools and difference between them?
how do u decide whether u need to do aggregations at database level or at Informatica level?
what are the concerns of OLTP and DSS systems?