ICFM Software
| Guiliani |
A Delphi data access component to support TQuery related SQL instructions against multiple tables
We created the Guiliani component to cover a design gap with the use of standard TUpdateSQL components against TQuery instances that draw data from more than one source table.
If the scope of a TQuery SQL statement has more than one source table then the standard TUpdateSQL only allows an INSERT/UPDATE/DELETE to be run against one of those tables.
With the Guiliani component this limitation has been removed. You can create any number of Guiliani compomnents and have multiple INSERT, DELETE or UPDATE commands being initiated against a single TQuery component.
Take the following example..
Two tables are used to hold a list of regions ('RegionMaster') and a set of child-to-parent links defining a region hierarchy ('RegionLinks').
| Table : RegionMaster | Table : RegionLinks |
| RegionUID | RegionUID |
| RegionTitle | ParentRegionUID |
| RegionPopulation | SiblingPosition |
To retrieve the data for a hierarchical display the following type of query might be required...
|
select regionUID, RegionTitle, RegionPupulation,ParentRegionUID,SiblingPosition from RegionMaster a, RegionLinks b where a.RegionUID = b.RegionUID order by ParentRegionUID, SiblingPosition |
With this SQL statement set into a TQuery component, the designer can use a linked TUpdateSQL component to handle INSERT, UPDATE and DELETE instructions. However, with a TUpdateSQL component the user would only be able to define one of the two source tables as a target for the SQL instructions.
With the TQuery used to drive a data aware Tree/Explorer visual component it is highly likely that data changes will be required against both source data tables.
This is where Guiliani scores! It allows SQL commands to be defined for both tables.
The designer may create any number of Guiliani components and then link them using the NextUpdateSQL property. After establishing the links between the different Guiliani instances, the first Guiliani component should be set up as the TQuery UpdateObject property.
To utilise the Guiliani component (TGuiLinkedUpdateSQL) follow the sequence of steps as listed below...
| a) | Review the TQuery SQL statement to determine how many source tables require an INSERT, UPDATE or DELETE instruction. |
| b) | For each source table that requires a SQL instruction place a TGuLinkedUpdateSQL component on the form or data module. |
| c) | Select the first TGuLinkedUpdateSQL component and set its NextUpdateSQL property to be the second instance. For the second instance set the NextUpdateSQL property to the third instance and so on. |
| d) | Select the TQuery component and set the RequestLive property to TRUE |
| e) | Then set the TQuery 'UpdateObject' to the first TGuLinkedUpdateSQL instance |
| f) | Now visit each TGuLinkedUpdateSQL component and double click on the component to edit the SQL properties. When the property editor form appears select one of the tables from the 'Table' combobox. Make sure that each instance of TGuLinkedUpdateSQL uses a different table. |
Guiliani works for Delphi 3 and 4
Guiliani is a freeware component, and is supplied with all source code. You may employ Guiliani in your applications without the need to register the product or pay any royalties.
The entire risk as to the use of this product is assumed by the user. ICFM Software do not assume liability for the use of this product. In no event will ICFM Software be liable for additional direct or indirect damages including any lost profits, lost savings, or other incidental or consequential damages arising from any defects, or the use or inability to use this product, even if ICFM Software have been advised of the possibility of such damages.
| Download Guiliani
component (a 22K zip file) |
|
| Contact ICFM Software | Return to DELPHI Components Home
page |