MySQL - Query
MySQL - Query
Runs a SQL statement on a MySQL database. It supports SELECT, INSERT, UPDATE, DELETE and other standard SQL statements. The results can be iterated with MySQL: For each result or read directly from the action returns.
- Version 2.0
- Version 1.0
Options
Connection ID
Reference to the MySQL: Connection action that will be used to run the query.
Query to be executed
SQL statement to run, for example SELECT * FROM usuarios WHERE ativo = 1.
Advanced options
Query timeout
Maximum time, in seconds, this query may run. When empty, the Default query timeout set on the MySQL: Connection applies. A value of 0 means no limit. When the limit is reached, the action fails; the connection's Time limits section describes what happens to the query and the connection. Optional field.
Options
Connection ID
Reference to the MySQL: Connection action that will be used to run the query.
Query to be executed
SQL statement to run, for example SELECT * FROM usuarios WHERE ativo = 1.
Advanced options
Timeout
Maximum time, in seconds, the action waits for the database response before failing. The default value is 120. Optional field.
Returns
Javascript code
actions["action-id"].resultsCount // number of records returned (Number)
actions["action-id"].query // query that was executed (Text)
actions["action-id"].results // query results (List)
actions["action-id"].insertedId // id of the inserted record, when applicable (Number)
actions["action-id"].affectedRows // number of affected rows (Number)
actions["action-id"].changedRows // number of changed rows (Number)
Field selection
- resultsCount — number of records returned by the query (Number)
- query — query that was executed (Text)
- results — query results (List)
- insertedId — id of the inserted record, when applicable (Number)
- affectedRows — number of affected rows (Number)
- changedRows — number of changed rows (Number)
Rules and Conditions
- The Connection ID and Query fields are required.
insertedId,affectedRowsandchangedRowsare relevant for INSERT, UPDATE or DELETE statements.resultsandresultsCountare relevant for SELECT statements.- In Version 2.0, the Query timeout field is optional and its value is in seconds;
0means no limit. - In Version 2.0, when Query timeout is empty, the connection's default query timeout applies.
- In Version 1.0, the Timeout field is in seconds and its default value is
120.