Use this function to create a #GdaSqlStatement of the specified type
type.
type of statement to create
contents, cast it depending on stmt_type
(for example to a #GdaSqlStatementSelect).
type of statement
Cleans any data set by a previous call to gda_sql_statement_check_validity().
Checks for any error in stmt'
s structure to make sure the statement is valid
(for example a SELECT statement must at least return a column, a DELETE statement must specify which table
is targeted).
If cnc
is not %NULL, then checks that all the database objects referenced in the statement actually
exist in the connection's database (for example the table being updated in a UPDATE statement must exist in the
connection's database for the check to succeed). This method fills the stmt-&
gt;validity_meta_struct attribute.
If cnc
is %NULL, then remove any information from a previous call to this method stored in stmt
. In this case,
the stmt-&
gt;validity_meta_struct attribute is cleared.
Also note that some parts of stmt
may be modified: for example leading and trailing spaces in aliases or
objects names will be removed.
a #GdaConnection object, or %NULL
If mstruct
is not %NULL, then checks that all the database objects referenced in the statement i
actually referenced in mstruct
(for example the table being updated in a UPDATE statement must exist in the
connection's database for the check to succeed).
This method sets the stmt-&
gt;validity_meta_struct attribute to mstruct
.
If mstruct
is %NULL, then remove any information from a previous call to this method stored in stmt
. In this case,
the stmt-&
gt;validity_meta_struct attribute is cleared.
Also note that some parts of stmt
may be modified: for example leading and trailing spaces in aliases or
objects names will be removed.
a #GdaMetaStruct object, or %NULL
Specifies stmt'
s type of compound
a #GdaSqlStatementCompoundType value
Adds the s
sub-statement to the stmt
compound statement. s'
s reference is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
a #GdaSqlStatement pointer
Creates a copy of stmt
.
Sets the name of the table to delete from in stmt
. value'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
a table name as a G_TYPE_STRING #GValue
Releases any memory associated to stmt
.
Sets the name of the resolution conflict algorithm used by stmt
. value'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
name of the resolution conflict algorithm, as a G_TYPE_STRING #GValue
Specifies a SELECT statement, the values inserted will be the result set of select
. select'
s
ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
a SELECT or COMPOUND #GdaSqlStatement pointer
Sets the name of the table to insert into in stmt
. value'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
name of the table to insert into, as a G_TYPE_STRING #GValue
"Normalizes" (in place) some parts of stmt,
which means stmt
may be modified.
At the moment any "*" field in a SELECT statement will be replaced by one
#GdaSqlSelectField structure for each field in the referenced table.
a #GdaConnection object, or %NULL
Sets the DISTINCT clause of stmt
.
distinct_expr'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
a TRUE/FALSE value
a #GdaSqlExpr pointer representing what the DISTINCT is on, or %NULL
Sets list of expressions selected by stmt
expr_list'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
a list of #GdaSqlSelectField pointers
Sets the FROM clause of stmt
from'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
a #GdaSqlSelectFrom pointer
Sets the ORDER BY clause of stmt
order_by'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
a list of #GdaSqlSelectOrder pointer
Creates a string representation of stmt
.
Sets the model of the transaction
value'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
a G_TYPE_STRING value
Sets the name of the transaction
value'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
a G_TYPE_STRING value
Sets the name of the resolution conflict algorithm used by stmt
. value'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
name of the resolution conflict algorithm, as a G_TYPE_STRING #GValue
Specifies that the field named fname
will be updated with the expression expr
.
fname
and expr'
s responsibility are transferred to
stmt
(which means stmt
is then responsible for freeing them when no longer needed).
Sets the name of the table to delete from in stmt
.
value'
s ownership is transferred to
stmt
(which means stmt
is then responsible for freeing it when no longer needed).
a table name, as a G_TYPE_STRING #GValue
Use this function to create a #GdaSqlStatement of the specified type
type.
type of statement to create
Converts a string to a #GdaSqlStatementType value, see also gda_sql_statement_type_to_string()
a string representing a #GdaSqlStatementType type
Converts a #GdaSqlStatementType to a string, see also gda_sql_statement_string_to_type()
a #GdaSqlStatementType value
This structure is the top level structure encapsulating several type of statements.