Re: [gnome-db] Last insert feature request



On Wed, 28 Nov 2007 10:55:32 -0600
"Daniel Espinosa" <esodan gmail com> wrote:

> 2007/11/28, Murray Cumming <murrayc murrayc com>:
> >
> > On Tue, 2007-11-27 at 18:36 -0600, Daniel Espinosa wrote:
> > > For today gda_server_provider_get_last_insert_id () returns a gchar*,
> > > but what about to return a GdaParameter?
> >
> > Why not just return a GValue* ?
> >
> 
> Becouse a GValue doesn't have a "name" property, that could be set to
> the field's name used to get the value from. With this name the
> developer will know how create the SQL to get the last inserted value,
> for example in PostgreSQL:

Wouldn't it be easier and more flexible to retrieve primary column name using 
provider's reflection? I know that last_insert_id is sometimes helpfull , but in practice 
this functionality is useless with SQLite ( IIRC ) and may foolish you with MySQL.

Personally I would store primary column name as "application's parameter" instead of
fetching it with every insert command.

Piotras


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