}
static void
-read_fields (const gchar *table_name)
+read_fields (const gchar *table_name, GdaServerOperation *op)
{
GError *error;
gda_value_stringify (gda_data_model_get_value_at (dm_fields, 2, row, NULL)),
g_value_get_int (gda_data_model_get_value_at (dm_fields, 3, row, NULL)),
g_value_get_int (gda_data_model_get_value_at (dm_fields, 4, row, NULL)));
+
+ if (!gda_server_operation_set_value_at (op,
+ gda_value_stringify (gda_data_model_get_value_at (dm_fields, 0, row, NULL)),
+ &error,
+ g_strdup_printf ("/FIELDS_A/@COLUMN_NAME/%d", row)))
+ {
+ g_warning ("Error on setting GdaServerOperation's value: %s.",
+ error != NULL && error->message != NULL ? error->message : "no details");
+ continue;
+ }
+ if (!gda_server_operation_set_value_at (op,
+ gda_value_stringify (gda_data_model_get_value_at (dm_fields, 1, row, NULL)),
+ &error,
+ g_strdup_printf ("/FIELDS_A/@COLUMN_TYPE/%d", row)))
+ {
+ g_warning ("Error on setting GdaServerOperation's value: %s.",
+ error != NULL && error->message != NULL ? error->message : "no details");
+ continue;
+ }
}
}
if (dm_fields != NULL)
continue;
}
- /*read_fields (gdacon, table_name);*/
- if (!gda_server_operation_set_value_at (op, "id", &error,
- "/FIELDS_A/@COLUMN_NAME/0"))
- {
- g_warning ("Error on setting GdaServerOperation's value: %s.",
- error != NULL && error->message != NULL ? error->message : "no details");
- continue;
- }
- if (!gda_server_operation_set_value_at (op, "INTEGER", &error,
- "/FIELDS_A/@COLUMN_TYPE/0"))
- {
- g_warning ("Error on setting GdaServerOperation's value: %s.",
- error != NULL && error->message != NULL ? error->message : "no details");
- continue;
- }
-
+ read_fields (table_name, op);
error = NULL;
if (!gda_connection_perform_operation (gda_conn_db, op, &error))