File Handling in C

Hi all,

I have a problem in handling files through C.

here is the problem im having:

i will query the database (for instance consider employees table )
for empno,ename,job,salary fields.The query returns me some 100 of rows. now i need to place them in a file in row wise pattern as they exist in the database.

now , if any row is updated in the database i need to update the same row in the file . also if any row is deleted i need to remove the same row in the file , and if any new row is inserted into the data base i need to insert the row in the file.

can any one suggest me any method to do this .
The performance is and main criteria(i mean time to do file operations. )

please help me in this regard,

thanks in advance,

Trinath Somanchi,
Hyderabad.

hmm writing a c program to do this would be time consuming, what is the database you are using. most databases have tools to unload data in flat file system and that eases a lot of work, in most databases these tools are really very efficient.
for eg if you are using the database informix, the tool is dbunload.
there will be similar tools for oracle, etc. So tell us what is the database client tools you are using?

OS=LINUX
Data base=ORACLE
C API = PRO*C

use exp or sqlplus(spool) cmd