Equinox Online Help - Language Reference - A to Z

Home

SQLRun

Applies to
SyntaxSQLRun DefinitionName, “Sql command string”
Action[Statement] Enables a SQL statement to be executed.
ScopeUsable anywhere where an external database is used as a repository through ADO.
Notes

A good use of this statement may be to initiate a batch update or delete.

BEWARE: SQL Server will not perform cascading deletions automatically like equinox, which handles parent/child relationships internally.

If the SQLRun statement updates a record, any clients currently viewing that record will need to be told to refresh to see the new value. This can be achieved by using the SQLTouch statement

It is possible to add Lock and Unlock to this statement to maintain data integrity.

To enforce data integrity further, you can use a commit or rollback command within SQL. If you use BEGIN, you MUST use either COMMIT or ROLLBACK at the end of the statement.

CategoryDatabases, Mirroring
See Also SQLTouch
Example

This example locks the Customers table (in the Orders definition) and deletes all records (using the SQL statement).

Lock customers
SQLRun definition, “begin”
SQLRun Orders, “Delete from customers“
SQLRun definition, “commit”
Unlock customers