SQL Operations
sql_database
Connects to a database and returns the connection identifier.
Arguments:
- :title
- Connection identifier. If it's omitted, "default" will be used.
- :type
- Database type. Which types are available depends on your Qt installation. A list can be found here.
- :name
- Database name (or file name in case of SQLite).
- :host
- Host name. This parameter is optional.
- :port
- Port number. This parameter is optional.
- :user
- User name. This parameter is optional.
- :password
- User password. This parameter is optional.
sql_query
Executes a SQL query and returns an invalid value.
Arguments:
- :database
- Database connection identifier (as returned by sql_database operation).
- :query*
- The query.
- ...
- Any number of parameters that will be bond to the placeholders in the query. Placeholders are specified using a name (same as corresponding argument name) with a colon (:) in front of it (Oracle style). The arguments passed may be either values, or lists. If lists are used, the query will be executed in batch mode.
sql_query_id
Executes a SQL query and returns the id of the inserted record, if it was an INSERT query. Otherwise returns invalid value.
See sql_query for argument description.
sql_query_value
Executes a SQL query and returns the value of the first column of the first row, if it was a SELECT query.
See sql_query for argument description.
sql_query_list
Executes a SQL query and returns a list that contains values from the first column, if it was a SELECT query.
See sql_query for argument description.
sql_query_record
Executes a SQL query and returns a record that contains the first row. Column names are used as field names.
See sql_query for argument description.
sql_query_table
Executes a SQL query and returns the whole table.
See sql_query for argument description.