Skip to main content
MySQL

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.


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.

Timeout

Maximum time, in seconds, the action waits for the database response before failing. The default value is 120. Optional field.

Returns

Javascript code

js
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, affectedRows and changedRows are relevant for INSERT, UPDATE or DELETE statements.
  • results and resultsCount are relevant for SELECT statements.