Re: [gnome-db] What about GdaQuery?
- From: "Vivien Malerba" <vmalerba gmail com>
- To: "Daniel Espinosa" <esodan gmail com>
- Cc: gnome-db-list gnome org
- Subject: Re: [gnome-db] What about GdaQuery?
- Date: Mon, 27 Mar 2006 10:42:29 +0200
On 3/26/06, Daniel Espinosa <esodan gmail com> wrote:
[...]
> >
> > You can create a dictionary using gda_dict_new() and tell it which
> > connection to use with gda_dict_set_connection(). Then you can load
> > the dictionary file using a simple gda_dict_load(); no need to try to
> > figure out the dictionary name.
>
>
> OK. Done.
Note that you don't need to have a dictionary at all! It's usefull to
have when you want to "use" the objects stored within it. For example
if you create a query using an SQL statement which mentions a table
which does not exist in the dictionary, then you can get a warning; if
you have no dictionary, you won't get anything.
[...]
> > At the moment you need to:
> > -> if necessary get and fill the parameters to execute the query
> > -> get the SQL for your query using
> gda_renderer_render_as_sql(query)
>
>
> Could you give me any simple (just this part) of create and reder the
> query, please?
If your query does not have any parameter, you can do:
gchar *sql;
sql = gda_renderer_render_as_sql (GDA_RENDERER (query), NULL, 0, NULL);
>
>
> > -> create a GdaCommand with that SQL
> > -> use gda_connection_execute_command() to get a list of
> GdaDataModel
> > (or gda_connection_execute_single_command() to get only
> one model).
> > -> use the returned data model in a GnomeDbGrid.
>
>
> I know this process from the oldest GDA then I could do it with out
> problems.
>
>
> > It's a bit complex though and I plan to simplify this a bit using a
> > gda_connection_execute_query() function.
>
>
> I think we need to simplify the API, and allow the developers with a few
> steps access the data he/she needs with out great complexity.
Yes.
Vivien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]