![]() |
|
#1
|
|||
|
|||
File handling in CHi 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. |
|
#2
|
|||
|
|||
Re: File handling in CQuote:
A common method for editing files in general goes something like this: Code:
Quote:
I don't know what this means. Reading and writing files is not something over which you have much control (disk buffering, etc. are functions of hardware and operating system software). Making the data base on disk have some kind of indexed structure where all records have exactly the same length might give some possibilities for optimizing access time, but I can't really know what might be appropriate without a lot more information. Regards, Dave |
|
#3
|
||||
|
||||
Re: File handling in CAfter you make all your changes in the database, rewrite the files. To try to change the file at the same time as the database defeats the purpose of the database itself. In other words, the reason for the database is so you don't have to manipulate flat files.
It's the same concept as purchasing a family car for the efficiency of transporting the family. Then when you have to go somewhere, half the family takes the car (your database), the other half takes their bicycles (your files). You're downgrading your efficiency and power for the sake of the old technology. __________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
Recent GIDBlog
US Elections and the ?Voter?s Responsibility? by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 08:44 |
| CD Burner Help - Power Calibration Error.... | JonBoy420 | Computer Hardware Forum | 110 | 05-Feb-2008 19:34 |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 11:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 12:28 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The