SQL Server Actions
SQL Server actions are used to interact with tables on SQL Server.
Actions
sqlserver.close
Closes connection with SQL Server.
Parameters:
connection - connection object with server. Connections are created using sqlserver.open action.
Returns:
This action has no return.
Exceptions:
This action returns no Exception
sqlserver.commit
Commit the transation on SQL Server.
Parameters:
connection - connection object with server. Connections are created using sqlserver.open action.
Returns:
This action has no return.
Exceptions:
This action returns no Exception
sqlserver.execute_sql
Execute a SQL command on SQL Server.
Parameters:
connection - connection object with server. Connections are created using sqlserver.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 SQL Server connection occurs.
sqlserver.open
Creates a new connection to SQL Server.
Parameters:
host - IP or hostname of the server to connect.
user - username to be used on SQL Server authentication.
password - password to be used on SQL Server authentication.
database - name of the database to connect with.
port (optional) - number of the port to connect with SQL Server.
Returns:
connection - connection stablished with SQL Server.
Exceptions:
ConnectionException - when problems with SQL Server connection occurs.
sqlserver.rollback
Rollback the transation on SQL Server.
Parameters:
connection - connection object with server. Connections are created using sqlserver.open action.
Returns:
This action has no return.
Exceptions:
This action returns no Exception
sqlserver.select
Execute a SQL query on SQL Server.
Parameters:
connection - connection object with server. Connections are created using sqlserver.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 SQL Server connection occurs.