if (drop_tables)
{
- gchar *sql;
-
- sql = g_strdup_printf ("DROP TABLE %s",
- table->name);
- gda_connection_execute_non_select_command (gda_conn_db,
- sql,
- NULL);
+ error = NULL;
+ op = gda_connection_create_operation (gda_conn_db, GDA_SERVER_OPERATION_DROP_TABLE, NULL, &error);
+ if (op == NULL
+ || error != NULL)
+ {
+ g_warning ("Error on creating GdaServerOperation: %s.",
+ error != NULL && error->message != NULL ? error->message : "no details");
+ }
+ else
+ {
+ error = NULL;
+ if (!gda_server_operation_set_value_at (op, table->name, &error,
+ "/TABLE_DESC_P/TABLE_NAME"))
+ {
+ g_warning ("Error on setting GdaServerOperation's value: %s.",
+ error != NULL && error->message != NULL ? error->message : "no details");
+ }
+ else
+ {
+ error = NULL;
+ if (!gda_connection_perform_operation (gda_conn_db, op, &error))
+ {
+ g_warning ("Error on performing GdaServerOperation: %s.",
+ error != NULL && error->message != NULL ? error->message : "no details");
+ }
+ }
+ }
- g_free (sql);
+ if (op != NULL)
+ {
+ g_object_unref (op);
+ }
}
/* sql builder for insert into */
if (drop_tables)
{
- gchar *sql;
-
- sql = g_strdup_printf ("DROP VIEW %s",
- view_name);
- gda_connection_execute_non_select_command (gda_conn_db,
- sql,
- NULL);
+ error = NULL;
+ op = gda_connection_create_operation (gda_conn_db, GDA_SERVER_OPERATION_DROP_VIEW, NULL, &error);
+ if (op == NULL
+ || error != NULL)
+ {
+ g_warning ("Error on creating GdaServerOperation: %s.",
+ error != NULL && error->message != NULL ? error->message : "no details");
+ }
+ else
+ {
+ error = NULL;
+ if (!gda_server_operation_set_value_at (op, view_name, &error,
+ "/VIEW_DESC_P/VIEW_NAME"))
+ {
+ g_warning ("Error on setting GdaServerOperation's value: %s.",
+ error != NULL && error->message != NULL ? error->message : "no details");
+ }
+ else
+ {
+ error = NULL;
+ if (!gda_connection_perform_operation (gda_conn_db, op, &error))
+ {
+ g_warning ("Error on performing GdaServerOperation: %s.",
+ error != NULL && error->message != NULL ? error->message : "no details");
+ }
+ }
+ }
- g_free (sql);
+ if (op != NULL)
+ {
+ g_object_unref (op);
+ }
}
error = NULL;