DELPHI SQL MULTI-TABLE UPDATE 
Author Message
 DELPHI SQL MULTI-TABLE UPDATE

I'm having a problem updating (Interbase) SQL tables that I'm using with a
data awre explorer hierarchy display component.

The problem arises in a form where I have an explorer component to the left
side of a form, with on the right side of the same form a set of data aware
controls that show the attributes of the tables being queried.  The tables
concerned are...

 Table: AppFuncDef

 AppFuncUID   INTEGER
 AppFuncTitle  VARCHAR
 WriteAccess   LOGICAL
 ScopeSelRequired  LOGICAL

 Table : AppFuncDefHier

 AppFuncUID   INTEGER
 ParentAppFuncUID  INTEGER
 SiblingPosition  INTEGER

The query used to support the explorer display is like...

 select * from AppFuncDef a, AppFuncDefHier b
 where a.AppFuncUID = b.AppFuncUID
 order by ParentAppFuncUID,SiblingPosition

In the attribute panel I have two data aware checkboxes to support
'WriteAccess' and 'ScopeSelRequired' (both from the 'AppFuncDef' table) user
data entry, and a data aware edit box for the 'SiblingPosition' integer
field (from the 'AppFuncDefHier' table).

How do I go about updating the values? Remember, the two checkboxes after
values in one table, the edit box in the 2nd table. The query is by default
a READ ONLY dataset, so I've set the 'CachedUpdates' property to TRUE and
used a TUpdateQuery component to allow modifications. But the latter only
seems to support the update of a single table.  Any ideas??



Wed, 18 Jun 1902 08:00:00 GMT  
 DELPHI SQL MULTI-TABLE UPDATE


Quote:
>How do I go about updating the values? Remember, the two checkboxes after
>values in one table, the edit box in the 2nd table. The query is by default
>a READ ONLY dataset, so I've set the 'CachedUpdates' property to TRUE and
>used a TUpdateQuery component to allow modifications. But the latter only
>seems to support the update of a single table.  Any ideas??

From the Delphi 3.02 Help:

Furthermore, if you access multiple tables using a joined query, then
you must provide one TUpdateSQL object for each table in the query,
and you must use the OnUpdateRecord event to make sure each update
object is used to write changes to the database.

Regards,

--
Marco Rocci
MicroEra srl
Turin, Italy



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MULTI TABLE SQL TQUERY UPDATES??

2. Delphi 2.0: Multi-User Paradox Table updating problem....

3. Delphi 2/Sybase SQL Error on first Update to table

4. Applying Updates in Delphi 3 Multi-tier

5. Cached Updates QUESTION: Sorting table of updated and non-updated records

6. Join Tables from multi aliases using SQL

7. Multi-user access to Paradox tables in Delphi 1.02

8. Multi-table (1-M-1) Relationships in Delphi

9. cheap multi-user SQL for 16-bit Delphi ?

10. Help with BDE and SQL Update Dates in Paradox Tables

11. Saving TMemo field data to a Blob field (Interbase Table) via SQL Update Query

12. How to UPDATE tables with SQL?

 

 
Powered by phpBB® Forum Software