return id;
}
+GdaSqlBuilderId
+gdaex_sql_builder_where_string (GdaExSqlBuilder *sqlb, GdaSqlOperatorType op,
+ const gchar *table_name,
+ const gchar *field_name,
+ const gchar *field_alias,
+ GdaSqlOperatorType where_op,
+ gchar *op1,
+ gchar *op2)
+{
+ GValue *val1;
+ GValue *val2;
+
+ GdaSqlBuilderId id;
+
+ val1 = g_new0 (GValue, 1);
+ g_value_init (val1, G_TYPE_STRING);
+ g_value_set_string (val1, op1);
+
+ val2 = g_new0 (GValue, 1);
+ g_value_init (val2, G_TYPE_STRING);
+ g_value_set_string (val2, op2);
+
+ id = gdaex_sql_builder_where (sqlb, op, table_name, field_name, field_alias, where_op, val1, val2, NULL);
+
+ g_value_unset (val1);
+ g_value_unset (val2);
+
+ return id;
+}
+
/**
* gdaex_sql_builder_order:
* @sqlb:
GdaSqlOperatorType where_op,
gint op1,
gint op2);
+GdaSqlBuilderId gdaex_sql_builder_where_string (GdaExSqlBuilder *sqlb, GdaSqlOperatorType op,
+ const gchar *table_name,
+ const gchar *field_name,
+ const gchar *field_alias,
+ GdaSqlOperatorType where_op,
+ gchar *op1,
+ gchar *op2);
void gdaex_sql_builder_order (GdaExSqlBuilder *sqlb, ...);
g_message ("sql: %s", gdaex_sql_builder_get_sql (sqlb, NULL, NULL));
+ sqlb = gdaex_sql_builder_new (GDA_SQL_STATEMENT_SELECT);
+
+ gdaex_sql_builder_from_v (sqlb,
+ "pippo", "pluto",
+ "topolino", "",
+ NULL);
+
+ gdaex_sql_builder_fields (sqlb,
+ "pippo", "id", "", NULL,
+ "pippo", "name", "the_name", NULL,
+ NULL);
+
+ gdaex_sql_builder_field (sqlb, "pippo", "income", NULL, NULL);
+
+ gdaex_sql_builder_join (sqlb, GDA_SQL_SELECT_JOIN_INNER,
+ "pippo", "id", "",
+ GDA_SQL_OPERATOR_TYPE_EQ,
+ "topolino", "id_pippo", "",
+ NULL);
+
+ gdaex_sql_builder_where_int (sqlb, 0,
+ "pippo", "id", "",
+ GDA_SQL_OPERATOR_TYPE_EQ,
+ 44, 0);
+
+ gdaex_sql_builder_where_string (sqlb, GDA_SQL_OPERATOR_TYPE_OR,
+ "pippo", "name", "",
+ GDA_SQL_OPERATOR_TYPE_DIFF,
+ "ichichc", NULL);
+
+ gdaex_sql_builder_order (sqlb,
+ "pippo", "name", "", TRUE,
+ "pippo", "id", "", FALSE,
+ NULL);
+
+ g_message ("sql: %s", gdaex_sql_builder_get_sql (sqlb, NULL, NULL));
+
g_object_unref (sqlb);
sqlb = gdaex_sql_builder_new (GDA_SQL_STATEMENT_SELECT);