Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Best way to update queries with joined data


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Dec 16, 2017 10:28 AM Last Post By: Mark Williams
Mark Williams

Posts: 120
Registered: 5/8/10
Best way to update queries with joined data  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 16, 2017 9:41 AM
I am running a single query to load large amounts of data from several tables using joins. The actual query is fairly large so I will use a simple example to illustrate what I am trying to do.

SELECT Table1.*, Table2.client_address, Table3.Telephone_No FROM Table1
LEFT JOIN Table2 ON Table2.client_id=Table1.id
LEFT JOIN Table3 ON Table3.client_id=Table1.id


This loads 1000s of records into a query object, "Query!".

Periodically I want to check if there are any changes to this data or any newly inserted records. I do this via a different query, "Query2" and if it returns changed/new data I try and update Query1 with the data from Query2, but this raises an error when I try and update fields client_address and telephone_no because the data cannot be modified.

Is there a way to do this or perhaps a better way of updating joined tables. I have chosen not to go down the query refresh route, because of the potential stress on the database in reloading all the data every time.
Mark Williams

Posts: 120
Registered: 5/8/10
Re: Best way to update queries with joined data  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 16, 2017 10:28 AM   in response to: Mark Williams in response to: Mark Williams
The solution is to change the queries updateOptions property so it does no CheckReadOnly
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02