Ricardo Lara Posted April 12, 2022 Share Posted April 12, 2022 I know flat files are not meant for this kind of scenario but I would like to know if there is a way to have multiple concurrent users reading/updating a flat file. I didnt have any issues with just a few users using the form, but when more users began working with it, we lost a bunch of records. What I would like to know is if there is a way to lock/unlock the file while reading or writing, or any other advise would be greatly appreciated. A colleague told me about the MATCH - MODIFY FILE command but I couldnt find detailed information about it. Thanks in advance. Ricardo Link to comment Share on other sites More sharing options...
David Beagan Posted April 12, 2022 Share Posted April 12, 2022 I dont think you can have multiple users updating a flat file at the same time. I dont think MATCH or MODIFY would help with this. For that matter, how is a single user able to update the flat file I suppose a user could keep appending records to the flat file. Why not use a relational database Link to comment Share on other sites More sharing options...
Warren Hinchliffe Posted April 13, 2022 Share Posted April 13, 2022 You need to have it in a DB or in a FOCUS file accessed from a sync machine (FOCUS_SU). Link to comment Share on other sites More sharing options...
Ricardo Lara Posted April 13, 2022 Author Share Posted April 13, 2022 Hi David, they way Im updating some rows in the flat file is doing a pre hold of the flat file, and having the IDs of the rows that I need to update in a string. After that, in a new TABLE FILE (format DFIX delimited with pipes) in the DEFINE I check if the current row needs to be updated (DECODE with the string), and update the values if thats the case or rewrite the values from the flat file. Link to comment Share on other sites More sharing options...
Ricardo Lara Posted April 13, 2022 Author Share Posted April 13, 2022 Thanks Waz, Ill have a look. Link to comment Share on other sites More sharing options...
Toby Mills Posted April 13, 2022 Share Posted April 13, 2022 You guys have a pretty hefty amount of WebFOCUS users there at Autozone - Id get a real table set up somewhere in a database youre allowed to write to. As you said at the outset, flat files just arent made for that sort of thing. MODIFY will work once you get to a database of some sort (or .foc files). Link to comment Share on other sites More sharing options...
steve hodos Posted April 14, 2022 Share Posted April 14, 2022 As you are new-ish: MODIFY is the old file/table update language. If you use HTMLFORMs to pass it variables, you can write to tables, or create NEW flat files. Best to think of it as a batch update language only- no GUI. If you want an integrated GUI / add-update-delete language, MAINTAIN is the command of CHOICE. Finally- I will second (third) Waz and Toby- a database is really the way to go when dealing with more than 2-3 users potentially doing updates at the same time. I am out of the infrastructure business now, but they used to ship a DB with 8x for those folks that needed something for their own repository- I am pretty sure you could also use that (but would not swear on a stack of PDFs, just in case). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now