InstallAnywhere 2018
The Run SQL Script action runs a SQL script on a local or remote database server. This action requires an existing database server host in the Hosts view on the Organization page. Once the database server has been added in the Hosts view, you can add the Run SQL Script action to a database server host in a view on the Sequence page.
The Run SQL Script action enables you to optionally create a SQL database on MySQL servers. When you are configuring this action, you can specify separate SQL scripts (install script and uninstall script) to run during installation and uninstallation.
Tip • The Choose Database Connection panel action and the Choose Database Connection console action enable end users to specify information for connecting to the database on which the SQL script is going to be run on databases. For more information, see Enabling End Users to Specify Database Connection Information.
Properties Tab
The Properties tab of the Run SQL Script action customizer has the following subtabs:
• | Server Settings Subtab |
• | Install Subtab |
• | Uninstall Subtab |
The Server Settings subtab on the Properties tab includes the following settings:
Setting |
Description |
|||||||||
Server Host |
Specify the server host to which your installer is connecting. By default, the entry in this setting is the user-defined variable $DB_SERVERHOST_VARIABLE$. You can specify a different variable if needed. |
|||||||||
Server Port |
Specify the port for the server connection. By default, the entry in this setting is the user-defined variable $DB_SERVERPORT_VARIABLE$. You can specify a different variable if needed. |
|||||||||
Database Name |
Specify the name of the database on which your installer is running the SQL script. By default, the entry in this setting is the user-defined variable $DB_NAME_VARIABLE$. You can specify a different variable if needed. |
|||||||||
User Name |
Specify the user name for the account that should be used to connect to the server through server authentication. By default, the entry in this setting is the user-defined variable $DB_USERNAME_VARIABLE$. You can specify a different variable if needed. |
|||||||||
Password |
Specify the password that corresponds with the specified user name for the account that should be used to connect to the server through server authentication. By default, the entry in this setting is the user-defined variable $DB_PASSWORD_VARIABLE$. You can specify a different variable if needed. |
|||||||||
Create Database |
Note • This check box is applicable for MySQL, Microsoft SQL Server, and PostgreSQL databases. To have the Run SQL Script action create the database on target systems before running the SQL script, select this check box. This check box is cleared by default. Note the following details about the run-time behavior that occurs if you select this check box:
For example, for a MySQL database, the default character set and collation are used. For DB2, default values of the following parameters are used: buffer pool name for table spaces, buffer pool name for indexes, the storage group, and the encoding scheme for database data.
|
The Install subtab on the Properties tab includes the following settings:
Setting |
Description |
Selected Script |
To specify a script file to bundle with your installer, select this option. Click Choose File to open the Choose a File dialog box. Then, browse to the script file you want your installer to run and click Open. |
Existing Script |
To specify a script file that exists on the target system, select this option. In the Existing Script text box, enter the path to the script file that you want your installer to run. |
SQL Statements Delimiter |
Identify the character that separates SQL statements. To override the default delimiter (a semicolon), enter the new character or characters (for example, \n or GO). The Run SQL Script action parses the SQL script and then sends each statement to the database driver for execution. Note • To view the currently selected script if you are bundling the script with your installer, click the View Script button. Note that the SQL script cannot be modified in the SQL Script Preview dialog box. |
The Uninstall subtab on the Properties tab includes the following settings:
Setting |
Description |
Selected Script |
To specify a script file to bundle with your uninstaller, select this option. Click Choose File to open the Choose a File dialog box. Then, browse to the script file you want your uninstaller to run and click Open. |
Existing Script |
To specify a script file that exists on the target system, select this option. In the Existing Script text box, enter the path to the script file that you want your uninstaller to run. |
SQL Statements Delimiter |
Identify the character that separates SQL statements. To override the default delimiter (a semicolon), enter the new character or characters (for example, \n or GO). The Run SQL Script action parses the SQL script and then sends each statement to the database driver for execution. Note • To view the currently selected script if you are bundling the script with your uninstaller, click the View Script button. Note that the SQL script cannot be modified in the SQL Script Preview dialog box. |
Rules, Tags, and Rollback Tabs
For information on the other tabs on this customizer, see the following:
• | Rules—Use this tab to add rules to the selected action. For more information, see Assigning a Rule to an Action and Rules Reference. |
• | Tags—Use this tab to add build configuration tags to the selected action. For more information, see Assigning Tags to Project Elements. |
• | Rollback—Use this tab to specify rollback behavior for the selected action. For more information, see Configuring Installation Rollback Behavior. |
See Also
Adding a SQL Database Host to Your Project
Including JDBC Drivers for Connecting to SQL Databases
InstallAnywhere 2018 Help LibraryMarch 2018 |
Copyright Information | Flexera |