libgdamm Reference Documentation |
Public Member Functions | ||||
Command (const Glib::ustring& text, CommandType type=COMMAND_TYPE_SQL, CommandOptions options=COMMAND_OPTION_STOP_ON_ERRORS) | ||||
Creates a new Command. | ||||
Command (const Command& src) | ||||
Command (GdaCommand* castitem, bool make_a_copy=false) | ||||
Command () | ||||
CommandType | get_command_type () const | |||
Gets the command type of cmd . | ||||
CommandOptions | get_options () const | |||
Gets the command options of cmd . | ||||
Glib::ustring | get_text () const | |||
Gets the command text held by cmd . | ||||
const GdaCommand* | gobj () const | |||
GdaCommand* | gobj () | |||
GdaCommand* | gobj_copy () const | |||
Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. | ||||
Command& | operator= (const Command& src) | |||
void | set_command_type (CommandType type) | |||
Sets the command type of cmd . | ||||
void | set_options (CommandOptions options) | |||
Sets the command options of cmd . | ||||
void | set_text (const Glib::ustring& text) | |||
Sets the command text of cmd . | ||||
~Command () | ||||
Protected Attributes | ||||
GdaCommand* | gobject_ | |||
Related Functions | ||||
(Note that these are not member functions.) | ||||
Gnome::Gda::Command | wrap (GdaCommand* object, bool take_copy=false) | |||
|
The Command object holds data needed to issue a command to the providers. Applications usually create a Command, set its properties (via the set_* methods) and pass it over to the database using the Connection methods.
Commands is that they can be reused. That is, applications don't need to create a command object every time they want to run a command on the connected database. Moreover, the ability to create command strings with placeholders allows the use of parameters to specify the values for those placeholders. Thus, an application can create a command of the form:
INSERT INTO employees VALUES (id, name, address, salary)
and reuse the same command over and over, just using different values for the placeholders.
The value for the placeholders is specified when sending the Command to a database connection, which is done via the Gda::Connection::execute function.
Gnome::Gda::Command::Command | ( | ) |
Gnome::Gda::Command::Command | ( | GdaCommand * | castitem, | |
bool | make_a_copy = false | |||
) | [explicit] |
Gnome::Gda::Command::Command | ( | const Command& | src | ) |
Gnome::Gda::Command::~Command | ( | ) |
Gnome::Gda::Command::Command | ( | const Glib::ustring & | text, | |
CommandType | type = COMMAND_TYPE_SQL , |
|||
CommandOptions | options = COMMAND_OPTION_STOP_ON_ERRORS | |||
) | [explicit] |
Creates a new Command.
If there are conflicting options, this will set options to GDA_COMMAND_OPTION_DEFAULT.
text | The text of the command. | |
type | The type of the command. | |
options | Additional command options. |
CommandType Gnome::Gda::Command::get_command_type | ( | ) | const |
Gets the command type of cmd .
CommandOptions Gnome::Gda::Command::get_options | ( | ) | const |
Gets the command options of cmd .
Glib::ustring Gnome::Gda::Command::get_text | ( | ) | const |
Gets the command text held by cmd .
const GdaCommand* Gnome::Gda::Command::gobj | ( | ) | const [inline] |
GdaCommand* Gnome::Gda::Command::gobj | ( | ) | [inline] |
GdaCommand* Gnome::Gda::Command::gobj_copy | ( | ) | const |
Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
void Gnome::Gda::Command::set_command_type | ( | CommandType | type | ) |
Sets the command type of cmd .
type | The command type. |
void Gnome::Gda::Command::set_options | ( | CommandOptions | options | ) |
Sets the command options of cmd .
If there conflicting options, it will just leave the value as before.
options | The command options. |
void Gnome::Gda::Command::set_text | ( | const Glib::ustring & | text | ) |
Sets the command text of cmd .
text | The command text. |
Gnome::Gda::Command wrap | ( | GdaCommand * | object, | |
bool | take_copy = false | |||
) | [related] |
object | The C instance |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
GdaCommand* Gnome::Gda::Command::gobject_ [protected] |