MySQL Actions
MySQL actions are used to interact with tables on MySQL Server.
Actions
mysql.close
Closes connection with MySQL Server.
Parameters:
connection - connection object with server. Connections are created using mysql.open action.
Returns:
This action has no return.
Exceptions:
This action returns no Exception
mysql.commit
Commit the transation on MySQL Server.
Parameters:
connection - connection object with server. Connections are created using mysql.open action.
Returns:
This action has no return.
Exceptions:
This action returns no Exception
mysql.execute_sql
Execute a SQL command on MySQL Server.
Parameters:
connection - connection object with server. Connections are created using mysql.open action.
sql - string with SQL command to be executed.
auto_commit (optional) - set if the auto commit on transaction should be used or not (default=True)
Returns:
result - grid with all results returned for SQL command.
count - number of lines returned by result.
affected_rows - number of lines affected by SQL command execution.
Exceptions:
ConnectionException - when problems with MySQL Server connection occurs.
mysql.open
Creates a new connection to MySQL Server.
Parameters:
host - IP or hostname of the server to connect.
user - username to be used on MySQL authentication.
password - password to be used on MySQL authentication.
database - name of the database to connect with.
port (optional) - number of the port to connect with MySQL Server.
Returns:
connection - connection stablished with MySQL Server.
Exceptions:
ConnectionException - when problems with MySQL Server connection occurs.
mysql.rollback
Rollback the transation on MySQL Server.
Parameters:
connection - connection object with server. Connections are created using mysql.open action.
Returns:
This action has no return.
Exceptions:
This action returns no Exception
mysql.select
Execute a SQL query on MySQL Server.
Parameters:
connection - connection object with server. Connections are created using mysql.open action.
sql - string with SQL command to be executed.
Returns:
result - grid with all results returned for SQL command.
count - number of lines returned by result.
Exceptions:
ConnectionException - when problems with MySQL Server connection occurs.