InstallAware for Windows Installer
 

My SQL

This plug-in provided command executes a SQL script on a My SQL database server. Supported server platforms include versions up to 8.x.

Server

Enter the network name or IP address of the physical machine that the server instance resides on. Use localhost for the local machine.

Port

Enter the name of the port that the server is listening for connections on.

User

Enter the name of a user authenticated to make changes on the server.

Password

Enter the password for the user named in the User field.

Return result in variable

Indicates the variable to hold the result of the script execution. If specified, this variable must have been previously defined in the setup script using the Set Variable command.

The variable will hold one of the following values, or a custom error message as described below:

Value Meaning
SUCCESS Connection to the server succeeded. The script executed successfully, or there were some script execution errors and Abort Execution on Script Error was not checked.
CONNECT_ERROR Connection to the server failed.
ERROR An unknown error occured.

In addition to the values in the table above, when Abort Execution on Script Error is checked, and an error occurs during script execution (where database and server connections succeeded), this variable holds detailed error information as follows: The variable is split into two parts, delineated by the string literal DELINEATOR. The first part of the variable holds the exact textual error message. The second part of the variable holds the exact SQL script fragment where execution errors occured. You may parse the variable using the Parse String function to extract both fields and utilize them separately.

Abort Exection on Script Error

Check this box to halt processing of the SQL script if any SQL statement fails. Uncheck this box to allow the SQL script to continue execution even if some SQL statements fail.

SQL Script

Type the SQL script to execute here, or click the Load Script button to load the script from a text file.

 Notes

  • You may use variables in your SQL scripts and connection fields.
  • No client software or libraries are required on the target system for this action to succeed. A TCP/IP connection to the physical machine that the server resides on is required.
  • If you wish to load your SQL Script from a file at runtime, use the special #FILESCRIPT# value to indicate this. This option is especially useful for very long scripts that contain tens of thousands of lines. If your script has the value #FILESCRIPT# at the first position in the first line of the SQL Script field, the script will be read from the file following the value. For instance, if you enter the value #FILESCRIPT#$SUPPORTDIR$\sqlscript.sql into the SQL Script field, the plug-in will load the file sqlscript.sql from the installer's support files (creatives) folder at run-time, and execute the script contained within that file.