Hello!
I need to have one or more transaction firing together, but to have this
situation I shoud have more than one connection as there's no Transaction
component , but sometimes it can be very slow starting a new connection.For this reason I am trying my hand to the cached updates. It is simple when I need to update one table, but I have problems in master-detail relationship. I probably fail in doing something, but really can understand where.
I use autoincrement indexes so I don't know the master key until I apply updates. I use two TZQuery components , and try to set mastersource,masterkey and linkedfields, but seems not to work well, each time I apply master's updates, I loose all records in the detail ( master maybe refreshes the detail). The same thing happens if I join the two tables using datasource property and the WHERE ID = :ID in the select. How can I menage master detail and cached updates? Thanks for any advice.
Marco
Cached Updates and master detail relationship
Moderators: gto, cipto_kh, EgonHugeist
-
- Senior Boarder
- Posts: 50
- Joined: 31.08.2006, 10:41
- Contact:
Detail dataset is automatically fill the key field with the value of master's key field. if master's key field is null (e.g. becouse the key field is autoincreament), the value of detail's key field also null.
Solution :
You first have to post (applyupdate) the master dataset (and get the key value) before you add new record on the detail dataset.
Regards.
Fauzan Badriawan
Solution :
You first have to post (applyupdate) the master dataset (and get the key value) before you add new record on the detail dataset.
Regards.
Fauzan Badriawan
What database are you using? In PostgreSQL I look up the required id for the field and enter it into the dataset. It can then be posted to the database (ApplyUpdates) when needed or discarded if the user decides to cancel the transaction.
I hope this helps,
Regards,
Ben
Code: Select all
SELECT nextval(seq_name);
I hope this helps,
Regards,
Ben