Re: [gnome-db] gda_data_model_update_row syntax



On Sat, 2003-10-18 at 23:31, Laurent Sansonetti wrote:
> On Fri, 2003-10-17 at 00:28, Paisa Seeluangsawat wrote: 
> > Anyway, I can't find updatable cursor in mysql C api, and postgre
> > doesn't seem to support it either [1].  I'm new at this so please
> > correct me if I'm wrong.
> 
> I checked as well, without more success.
> 
> > Despite that, I think we can still implement update_row() by
> > generating a SQL command like,
> > 
> >   'update ... where column1=old_value1, column2=old_value2... limit 1'
> 
> I don't really like this way, even if it should work in all cases.
> 
> For example I dislike when the wrong row will be updated in a
> homogeneous data model.
> 
well, the provider should be able to know what the primary key is for a
table, and update/remove based on that primary key. In tables without
primary keys, we might a) try to update the row, and return an error if
more than 1 row is modified, or b) set the data model to non-editable.

> Anyway, drawback of this method is that we have to store all values of
> the updatable data model somewhere, in order to use them in the UPDATE
> instruction (or maybe I'm missing something).
> 
as I said, the provider should be able to know what the primary key is
for a table, and then just use it for all updates.

cheers




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