[gnome-db] Getting a Table by name



If I have a GdaConnection and the table name I want to insert data into, how can I do it?

I'm trying to use GdaDictDatabase but it seems not be completly implement (it doesn't declare any code to assing a Dict as a property using g_object_set_property); then I can't get the GdaDictTable using its name.

But most of it, is that I can't create a dictionary and update the XML file, could you help me?

I think if the dict isn't correctly created, you can't have a valid GdaQuery?

Can I pass directly to gda_query_target_new(query, table_name) a string given for the user caller?

I have the following code:

    dict = gda_dict_new();
    gda_dict_set_connection(dict, cnn);
   
    gda_dict_set_xml_filename(dict,
                                gda_dict_compute_xml_filename(dict,
                                                        gda_connection_get_dsn(cnn),
                                                        "GDAAPP", error));
    g_message("File dict = %s\n", gda_dict_get_xml_filename(dict));
    gda_dict_load(dict, error);
   
    if(gda_dict_update_dbms_data (dict, 0, NULL,
                                error))
        g_message("Error Dict Not updated...\n");
   
    /* Getting the Table from the Dictionary */
    db = gda_dict_database_new(dict);
    table = gda_dict_database_get_table_by_name(db, table_name);

--
Trabajar, la mejor arma para tu superación
"de grano en grano, se hace la arena" (R) (entrámite, pero para los cuates: LIBRE)

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