/*
- * Copyright (C) 2010-2012 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2013 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
while (gtk_events_pending ()) gtk_main_iteration ();
/* check if already exists */
- sql = g_strdup_printf ("SELECT id FROM %stables WHERE name = '%s'",
+ sql = g_strdup_printf ("SELECT id"
+ " FROM %stables WHERE name = '%s'"
+ " AND id_datasources = %d",
priv->commons->prefix,
- table_name);
+ table_name,
+ id_ds);
error = NULL;
stmt = gda_sql_parser_parse_string (priv->commons->gdaparser, sql, NULL, &error);
if (stmt == NULL || error != NULL)
field_name = gda_value_stringify (gda_data_model_get_value_at (dm_fields, 0, row_fields, NULL));
/* check if already exists */
- sql = g_strdup_printf ("SELECT id FROM %sfields WHERE id_tables = %d AND name = '%s'",
+ sql = g_strdup_printf ("SELECT id"
+ " FROM %sfields"
+ " WHERE id_tables = %d"
+ " AND name = '%s'",
priv->commons->prefix,
new_id,
field_name);