You are not logged in.
Pages: 1
Hi,
i found this shorted example for updating a value on another site:
var
ExistingMovie: TMovie;
ExistingMovie := TMovie.CreateAndFillPrepareJoined(DBServer,
'Title = ?', [], ['District 9']);
ExistingMovie.Title := 'District 10';
ServerDB.Update(ExistingMovie);
What is the best way to implement an update for a joined table here?
For Example we have another table which references with a id here and the update should take care of both tables.
I hope my question is clear.
If not, i can post a small part of the code.
Thanks.
Moe
Offline
You may just do it in two steps, with direct ORM on the two tables:
1. OneFieldValue() to retrieve the Int64/TID of the joined field
2. UpdateField() to change the 'Title' field
I guess you don't need the full TMovie information.
Or you may just specify the updated field as additional parameter to Update().
Offline
Hi ab,
thanks for your quick answer.
i have some more questions here:
when i want to update one TSQL-Record complete with all values, what is the best way to do this?
To I have to name all columns which i want to update?
I tried already to use the Update(tsqlrecord) but this does not seem to work (no error, but no values are changed in db).
In my TSQL-Record, there is another TSQL-Record as a property.
Is it possible to update directly within one update-command also the joined table?
When i want to update now the complete information in both related lines, what would be the best way?
Are there some examples for updating information in an sql-lite database, also for joined tables?
Really thanks for your support here.
Offline
Pages: 1