Subject Re: [IBO] Join edit
Author TeamIBO
> What I want to do is present a GUI which to the user seems to be one
> table. When the user inserts into the "main" table, the joined table
> is also updated(either inserted into if the key field is not found,
> or updated if any edits where done to the joined table as a whole).
> All fields from both tables must be editable in for eg a grid. How
> is this accomplished?

In theory you can do this sort of thing by setting up an editable view
(a view defined using the join with triggers to maintain the fields).
In practice this tend to be a bit tricky - partly because there are
bugs in IB/FB.

Another option is to setup inside stored procedures (one to do the
select, another for the edit and so on). The problem here is that you
cant do a select by key from a stored procedure. So if you need to
refresh a row after an update you need to refresh the entire query.
This means it is generally not appropriate for large result sets.

A third option is to setup the join as you have it and then setup
stored procedures to do the edit/insert/delete. Not sure whether this
works for non-KeyRelation fields or not (I've never tried it).

A fourth option is to setup simple as a master-detail (detail would
only have one record). This wont work in a grid but works fine on a
"normal" form (and I dislike grids for editing anyway.


hth

--
Geoff Worboys - TeamIBO
Telesis Computing