Page 1 of 1

Delete a record from a file

PostPosted: Wed Sep 01, 2010 1:28 pm
by Bhavanijenjeti
Hi All,


I am trying to delete a record from a temporary flat file.
Can some one help me with the synatx in easytrieve to empty a temporary file or delete a specific record.

Thank You,
Bhavani

Re: Delete a record from a file

PostPosted: Wed Sep 01, 2010 1:32 pm
by NicC
Like any other language using flat, ie sequential, files you read file A and write the records you want to file B.

Re: Delete a record from a file

PostPosted: Wed Sep 01, 2010 10:52 pm
by dick scherrer
Hello,

Once a record has been written to a sequential file, it cannot be "deleted". As suggested, you can copy the file omitting records that are not needed in the "new" file.

To create an empty file, open the file as output and do not write any records. When the file is closed, it will have no records (i.e. it will be empty).