Re: [gnome-db] gda_data_model_update_row syntax



On Monday 13 October 2003 00:01, Paisa Seeluangsawat wrote:
> Three e-mails in a row :-),
>
> I was going to implement [remove/update]_row for mysql.  But I'm not
> even sure how the user is supposed to use it.  My guess is,
>
>      GdaRow *row = gda_data_model_get_row (model, row_number);
>      ... manipulate row data somehow ...
>      gda_data_model_update_row (model, row);
>
> There are many problems with this,
>
>   1) gda_data_model_get_row() return const GdaRow*.  It looks very much
>      like *row isn't to be edited.
>
>   2) Even after casting const off row*, gda_row_get_value() also
>      return const GdaValue*.
>
>   3) Granted that the user edited *row somehow, how am I going to know
>      which record *row was from?  Both gda_row_set_numer() and
>      gda_row_set_id() are public functions.  So, I can't rely that the
>      user wouldn't use it.
>

Something else to keep in mind is that the ability to update a row (as opposed 
to executing an update SQL statement) is dependant on support for updatable 
cursors within the target database.

We may want to add a 'GDA_CONNECTION_FEATURE_UPDATABLE_CURSOR' to the 
GdaConnectionFeature enum to allow the user to check for this before 
attempting to perform the update.


Ian




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