docs.roxen.comBack to normal mode
DocsRoxenWebServer 5.2Web Developer ManualDatabase Tags
Copyright © 2015, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com

<sqlquery/>

Provided by module: Tags: SQL tags

Executes an SQL query, but doesn't do anything with the result. This is mostly used for SQL queries that change the contents of the database, for example INSERT or UPDATE.


Attributes

db="database"

Which database to connect to, among the list of databases configured under the "DBs" tab in the administrator interface. If omitted then the default database will be used.


host="url"

A database URL to specify the database to connect to, if permitted by the module settings. If omitted then the default database will be used.

The database URL is on this format:

driver://[username[:password]@]host[:port][/database]

where driver is the database protocol, e.g. "odbc", "mysql", "oracle", "postgres", etc.

For compatibility this can also be a database name as given to the "db" attribute.


module="string"

Access the local database for the specified Roxen module, if permitted by the module settings. This attribute is deprecated.


query="SQL statement"

The actual SQL-statement.


parse

If specified, the query will be parsed by the RXML parser. Useful if you wish to dynamically build the query. This attribute is deprecated and will have no effect if the server compatibility level is above 2.1.


bindings="name=variable,name=variable,..."

Specifies binding variables to use with this query. This is comma separated list of binding variable names and RXML variables to assign to those binding variables.

Note: For some databases it is necessary to use binding variables when inserting large values. Oracle, for instance, limits the query to 4000 bytes.

<set variable='var.foo' value='texttexttext'/> <sqlquery query='insert into mytable VALUES (4,:foo,:bar)' bindings='foo=var.foo,bar=form.bar'/>

mysql-insert-id="variable"

Set the given variable to the insert id used by MySQL for auto-incrementing columns. Note: This is only available when MySQL is used.


charset="string"

Use the specified charset for the SQL statement. See the description for the "sql" emit source for more info.