Re: Updateable recordsets



Le dim, 30 jui 2000, vous avez écrit :
> I have taken a look at the possibility to make
> recordsets updateable. Unfortunately, I have
> found some issues that really could get us
> in the way:
> 
> With client-side cursor (only possibility that
> is currently implemented) the gda-server does
> not know which is the current record and thus
> can't update/delete it. Probably, the update
> of recordsets would have to be implemented
> client-sided (,too).
> 
> Apart from that, we will run into problems
> when we have joins. Consider the statement
> 
> select name, country_id, text from customer,
> country where customer.country_id = country.id;
> 
> We can't find out if text is a field of the
> customer table or of the country table,
> except we analyze the database schema.
> 
> When field values are allowed to be changeable
> (which must be to make recordsets updateable),
> a change of the value of the field "country_id"
> would have to result in re-reading the country
> table to obtain the new value for country.text.
> 
> All that means very much that GDA will have
> to deal with how the tables of the database
> are related to each other.
> Of course that would be possible to do by
> analyzing the SQL select statements and
> the table schemes, but at a high effort.

There are 2 possibilities here:
1) use XML queries which can be easily parsed to get the knowledge of the query
logical structure; or
2) implement a kind of database context a bit in the way X11 uses a graphical
context: that context would hold all the relations, etc, and any recordset
would be modified from learning what is in that database context.

The 2nd solution is better because more exhaustive and precise (some relations
may not appear in the query itself, or the user might not want to use all the
relations mentionned in the query).

> On the other hand, there will in every case
> sit an application on top of GDA that already
> knows about all these relationships.
> Exactly that application that generates the
> SQL select statement could with not very
> much additional effort create like SQL insert,
> delete and update statements.
> 

Of course! This is an application's job to do so, though we could have some
gnome-db widgets (bonobo controls?) to help, maybe?

> Not that I want to get out of it :) but I really
> have to ask this question again:
> 
> Do we really want updateable recordsets in gda?

I think that would be nice, but it will be difficult to implement in a correct
way! Meanwhile we should concentrate on making GDA/gnome-db more usable on the
other aspects, and put this item on the TODO list.

Cheers,

Vivien




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]