The SQL Command dialog box can be opened on creating or editing an SQL command.
Set up SQL command parameters:
Name. Sets SQL command name. SQL Command is used by default.
Use Another Connection.If the checkbox is selected, a box for selecting a database from the repository becomes available. On selecting the database, the driver specified in the setting of the selected database is set automatically in the Driver box. Click the button to clear the box. During an update, the SQL command will be executed in the specified connection in accordance with the database settings.
Driver. When an SQL command is created or edited, a driver is indicated in the box. This driver should correspond to the settings of the current repository where the update is created or opened. If another connection is used for the command, the driver is indicated in accordance with settings of the specified database. Select the DBMS type in the drop-down list. For details about available DBMS see the Supported DBMS section.
SQL Command. The command text should be written in the box. One can use hints with keywords (SELECT, DROP, ALTER) and repository objects or objects of a database specified in another connection. In the text of a command one can use:
Brackets "Begin…end;". One can specify several SQL expressions within the brackets. To separate SQL expression within the brackets, use a semicolon. SQL command example:
begin
delete from OBJ32305 where Field2=78;
insert into OBJ32305 values('Moscow', 56,13);
end;
The / character is used for separation of several SQL expressions. A separator must be the only symbol in a row. SQL command example:
delete from OBJ32305 where Field2=78
/
insert into OBJ32305 values('Moscow', 56,13)
The ; character is used for separation of several SQL expressions. The separator is placed at the end of an SQL expression. SQL command example:
delete from OBJ32305 where Field2=78;
insert into OBJ32305 values('Moscow', 56,13)
Command text is automatically saved for the selected driver. Text can be specified for each driver. The text, which was previously set for the driver, is displayed on changing the driver.
NOTE. Separate use of the semicolon separator is denied for Oracle drivers. It can be used only within the "Begin…end;" brackets.
Skip Errors.The checkbox selection enables the user to skip SQL command execution if its execution caused any errors (no error message is displayed), and continue the update process starting with the next element. If the checkbox is deselected and an error occurs while executing an SQL command, the update process is aborted (an error message is displayed).
Apply for All DBMS. The command is used to set the current text of an SQL command for all DBMS drivers. A confirmation is required to execute the operation.
NOTE. If no text is set for other DBMS drivers, no message appears.
The database of the SQL command specified in the connection when the Use Another Connection checkbox is selected can be not found on opening the update. In this case an altered icon is displayed next to the command:
Open command parameters to check command settings. If parameters of multiple commands need to be checked, it is possible to open the edit dialog box for all selected commands and specify the database. In this case the parameters dialog box looks as follows:
The user needs to select a database from the list of repository objects. The selected database is set for all edited SQL commands.
See also: