Delete First 3 Rows & Last 3 Rows in Target Table

How to delete first 3 rows & last 3 rows in target table in Informatica?

Questions by jhotsna

Showing Answers 1 - 15 of 15 Answers

atulch

  • Aug 30th, 2011
 

For deleting the first 3 rows in the target table, you can write a Post-SQL in the Session task -
delete from < tablename > where rownum < 4;

  Was this answer useful?  Yes

sridkaretl

  • Oct 21st, 2011
 

hi,

you can first use sorter transformation and do asc or desc then use rank transformation and select the number of ranks, and by using sql condition can remove first 3 and last 3 rows.

regards,
karthik

  Was this answer useful?  Yes

sridkaretl

  • Oct 21st, 2011
 

As i have mentioned previously first sort the table using sorter transformation and then use rank transformation. next by using expression transformation you can delee all rows as asked in question.

Sorry, if i am wrong. Please correct me.

Regards,
Karthik

  Was this answer useful?  Yes

Hi,

We can use a sql in the sql override:

select count(1) from
(select * from where rownum<= (select count(1)-3 from )
minus
select * from where rownum<=3)

This query will remove the first 3 and the bottom 3 records.

Thanks

  Was this answer useful?  Yes



1. SQ
2. Expression --> Connect the expression with the Sequence Generator
3. Aggregator with one column(key column if any)
Out_Count=count(*)
Dummy_count=1
3. Expression with all the values
Add one dummy port, Dummy_All=1
4. Joiner transformation(Normal Join) on the Dummy Column.
5. Filter: Cntr > 3 && Cntr <= Count(*)-3

Hope this helps!!!
Filter:

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions