![]() |
![]() |
![]() |
GNOME Data Access 3.0 manual | ![]() |
---|---|---|---|---|
enum GdaCommandOptions; enum GdaCommandType; GdaCommand; GdaCommand* gda_command_new (const gchar *text, GdaCommandType type, GdaCommandOptions options); void gda_command_free (GdaCommand *cmd); GdaCommand* gda_command_copy (GdaCommand *cmd); const gchar* gda_command_get_text (GdaCommand *cmd); void gda_command_set_text (GdaCommand *cmd, const gchar *text); GdaCommandType gda_command_get_command_type (GdaCommand *cmd); void gda_command_set_command_type (GdaCommand *cmd, GdaCommandType type); GdaCommandOptions gda_command_get_options (GdaCommand *cmd); void gda_command_set_options (GdaCommand *cmd, GdaCommandOptions options);
The GdaCommand structure holds data needed to issue a command to the providers. Applications usually create a GdaCommand (via gda_command_new), set its properties (via the gda_command_set_* functions) and pass it over to the database using the GdaConnection functions.
GdaCommand commands can only be plain SQL without any variable in it, they are however very easy to use. For prepared statements and/or usage of variables in SQL statements, use a GdaQuery object.
typedef enum { GDA_COMMAND_OPTION_IGNORE_ERRORS = 1, GDA_COMMAND_OPTION_STOP_ON_ERRORS = 1 << 1, GDA_COMMAND_OPTION_BAD_OPTION = 1 << 2 } GdaCommandOptions;
GdaCommandOptions
is deprecated and should not be used in newly-written code.
And OR'ed combination of GDA_COMMAND_OPTIONS_* values.
typedef enum { GDA_COMMAND_TYPE_SQL, GDA_COMMAND_TYPE_XML, GDA_COMMAND_TYPE_PROCEDURE, GDA_COMMAND_TYPE_TABLE, GDA_COMMAND_TYPE_SCHEMA, GDA_COMMAND_TYPE_INVALID } GdaCommandType;
GdaCommandType
is deprecated and should not be used in newly-written code.
typedef struct { gchar *text; GdaCommandType type; GdaCommandOptions options; } GdaCommand;
GdaCommand
is deprecated and should not be used in newly-written code.
GdaCommand* gda_command_new (const gchar *text, GdaCommandType type, GdaCommandOptions options);
gda_command_new
is deprecated and should not be used in newly-written code.
Creates a new GdaCommand from the parameters that should be freed by calling gda_command_free.
If there are conflicting options, this will set options
to
GDA_COMMAND_OPTION_DEFAULT.
|
the text of the command. |
|
a GdaCommandType value. |
|
a GdaCommandOptions value. |
Returns : |
a newly allocated GdaCommand. |
void gda_command_free (GdaCommand *cmd);
gda_command_free
is deprecated and should not be used in newly-written code.
Frees the resources allocated by gda_command_new.
|
a GdaCommand. |
GdaCommand* gda_command_copy (GdaCommand *cmd);
gda_command_copy
is deprecated and should not be used in newly-written code.
Creates a new GdaCommand from an existing one.
|
command to get a copy from. |
Returns : |
a newly allocated GdaCommand with a copy of the data in cmd .
|
const gchar* gda_command_get_text (GdaCommand *cmd);
gda_command_get_text
is deprecated and should not be used in newly-written code.
Gets the command text held by cmd
.
|
a GdaCommand. |
Returns : |
the command string of cmd .
|
void gda_command_set_text (GdaCommand *cmd, const gchar *text);
gda_command_set_text
is deprecated and should not be used in newly-written code.
Sets the command text of cmd
.
|
a GdaCommand |
|
the command text. |
GdaCommandType gda_command_get_command_type (GdaCommand *cmd);
gda_command_get_command_type
is deprecated and should not be used in newly-written code.
Gets the command type of cmd
.
|
a GdaCommand. |
Returns : |
the command type of cmd .
|
void gda_command_set_command_type (GdaCommand *cmd, GdaCommandType type);
gda_command_set_command_type
is deprecated and should not be used in newly-written code.
Sets the command type of cmd
.
|
a GdaCommand |
|
the command type. |
GdaCommandOptions gda_command_get_options (GdaCommand *cmd);
gda_command_get_options
is deprecated and should not be used in newly-written code.
Gets the command options of cmd
.
|
a GdaCommand. |
Returns : |
the command options of cmd .
|
void gda_command_set_options (GdaCommand *cmd, GdaCommandOptions options);
gda_command_set_options
is deprecated and should not be used in newly-written code.
Sets the command options of cmd
.
|
a GdaCommand |
|
the command options. |