How to move last n records of a file into db2 table



IBM's flagship relational database management system

How to move last n records of a file into db2 table

Postby pradeepgowda » Fri Jan 22, 2010 2:10 pm

how to move last n records of a file into db2 table.

(eg: how will i move last 5 records from a sequential file to db2 table)
pradeepgowda
 
Posts: 40
Joined: Mon Jan 04, 2010 4:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to move last n records of a file into db2 table

 

Re: How to move last n records of a file into db2 table

Postby dick scherrer » Sat Jan 23, 2010 12:23 am

Hello,

Create a file containing only the last 5 records and load these into the table
or
In a program, read the file moving each record into a 5-element array that is shifted down each time a new record is read. When the file reaches the end, the last 5 records will be in the array. INSERT these into the table.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post