i have oracle table A and target B. i don't know how many
records. i want get get last record in table A as first record
in target table B. write a sql query?

Answers were Sorted based on User's Feedback



i have oracle table A and target B. i don't know how many records. i want get get last record..

Answer / devi

CREATE TABLE B
AS
SELECT * FROM A
ORDER BY ROWNUM DESC;

Is This Answer Correct ?    26 Yes 4 No

i have oracle table A and target B. i don't know how many records. i want get get last record..

Answer / priyank

In Informatica, make table A as Source and follow the below
mapping:

SRC_A --> AGG --> TGT_B

AGG: Do not check any of the columns for group by and pass
the output to target B. In this way, only the last row will
be passed through.

Is This Answer Correct ?    1 Yes 1 No

i have oracle table A and target B. i don't know how many records. i want get get last record..

Answer / upendra

select * from (select rownum as num,a.* from A a) where num=(select count(*) from A);

Is This Answer Correct ?    0 Yes 0 No

i have oracle table A and target B. i don't know how many records. i want get get last record..

Answer / upendra

In Informatica mapping we can find source A last record into Target B first record.


SRC-->Rank--> TGT

note:rank transformation edit propertities tab assign bottom=1

Is This Answer Correct ?    1 Yes 1 No

i have oracle table A and target B. i don't know how many records. i want get get last record..

Answer / dilip ingole

by using with clause


WITH DATA AS(SELECT NUM,ROWNUM RN ,COUNT(1)OVER() CNT FROM A)
SELECT NUM,RN FROM DATA WHERE RN=1
UNION
SELECT NUM,RN FROM DATA WHERE RN=CNT;

Is This Answer Correct ?    0 Yes 0 No

i have oracle table A and target B. i don't know how many records. i want get get last record..

Answer / pooja

CREATE TABLE B
AS
SELECT *
FROM
(SELECT *
FROM
(SELECT *,ROWNUM R
FROM A)
ORDER BY R DESC)
WHERE R=1;

Is This Answer Correct ?    0 Yes 1 No

i have oracle table A and target B. i don't know how many records. i want get get last record..

Answer / mr lee

Select * From Table A Where ROWID = (Select Max(ROWID) From
Table A
Union
Select * From Table B Where Rownum = 1

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Informatica Interview Questions

What are the new features of informatica 7.1?

2 Answers  


what is the location of parameter file in informatica?

1 Answers   TCS,


How can a transformation be made reusable?

0 Answers   Informatica,


tell me some dimension tables names in banking domain informatica project(dont tell like depends on project, tell me names of dimension and fact table names in your project)?

3 Answers   IBM, Patni, TCS,


what is mystery dimension?

1 Answers  






Can anyone guide me the steps to install informatica PC 8.5.1 with database as oracle

1 Answers  


Hi, I am new to Informatica, What is a flat file and how to use flat file in infomratica please help me.

10 Answers   CSC,


generate Unique sequence numbers for each partition in session with Unconnected Lookup ? Hi All, Please help me to resolve the below issue while Applying partitioning concept to my Session. This is a very simple mapping with Source, Lookup , router, and target. I need to Lookup on the target and compare with the source data, if any piece of data is new then Insert, and If any thing change in the existed data then Update. while Inserting the new records to the target table I'm generating sequence numbers with Unconnected lookup, by calling the maximum PK ID from the target table. The above flow is working fine from last one year. Now I wish to apply the Partitioning concept to the above floe(session) At source I used 4 pass through partitions.(For Each partition different filter conditions to pull the data from source) at Target I used 4 passthrough Partitions. it is working fine for some data, but for some rows for Insert Operation , it is throwing Unique key errors, because while Inserting the data it is generating the same sequence key twice. In detail : 1st row is coming from 1st partition and generated the sequence number 1 for that row. 2nd row is coming from 1st partition and generated the sequence number 2 for that row 3rd row is coming from the 2nd partition generated the sequence number 2 again for that row. (it must generate 3 for this row) the issue is becuase of generating the same sequence numbers twice for different partitions. Can any one Please help me to resolve this issue. While Applying partitions how can I generate a Unique Sequence numbers from Unconnected lookup for Each partitioned data. Regrads, N Kiran.

2 Answers   Tech Mahindra,


How to recover the standalone session?

2 Answers  


Can you use the maping parameters or variables created in one maping into any other reusable transformation?

1 Answers  


Can I use same Persistent cache(X.Dat) for 2 sessions running parallely? If it is not possible why?If yes How?

0 Answers  


What is Datadriven?

2 Answers   Informatica,


Categories