I'm working with a normalised dbase and use a set of temporary files to store information about customers and their orders before committing to the permament versions of the files.
Existing orders can be amended, new orders can be added.
I'm building the routine(s) to copy the temporary files to the permanent omes and wondered what's the best way to compose the order handling routine which needs to update the order if present and add it if not.
I can do this quite easily in VBA, but I've seen many posts which state that SQL is quicker than recordset handling and I would expect, involves less code.
SQL, I'm not so proficient with:-
I'd like to be able to run a query which rattles through the temp orders (header) file and attempts to update related entries on the orders file, if the order number is not found, execute an insert to add it. Ideally, the temp order lines and order lines files could be managed at the same time, rather than separately.
I can post the file designs if necessary, but the solution should be generic as I'm certain I'll be using the technique elsewhere.
Thanks in advance...
Existing orders can be amended, new orders can be added.
I'm building the routine(s) to copy the temporary files to the permanent omes and wondered what's the best way to compose the order handling routine which needs to update the order if present and add it if not.
I can do this quite easily in VBA, but I've seen many posts which state that SQL is quicker than recordset handling and I would expect, involves less code.
SQL, I'm not so proficient with:-
I'd like to be able to run a query which rattles through the temp orders (header) file and attempts to update related entries on the orders file, if the order number is not found, execute an insert to add it. Ideally, the temp order lines and order lines files could be managed at the same time, rather than separately.
I can post the file designs if necessary, but the solution should be generic as I'm certain I'll be using the technique elsewhere.
Thanks in advance...
Comment