Page 1 of 1

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

PostPosted: Fri Jan 22, 2010 2:10 pm
by pradeepgowda
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)

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

PostPosted: Sat Jan 23, 2010 12:23 am
by dick scherrer
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.