SQLRTGetComponentScriptError2

InstallShield 2016 » InstallScript Language Reference

Project • This information applies to InstallScript projects.

The SQLRTGetComponentScriptError2 function retrieves the last error while executing a SQL script that is associated with the component. This function takes several parameters (szScriptName, szTechnology, szServer, and szDB) that the SQLRTGetComponentScriptError function does not.

Note • The SQLRTGetComponentScriptError function uses SQLRT.dll; therefore, it can be called only after SQLRTInitialize2 has already been called. To learn more, see Using the SQL Run-Time Functions in InstallScript and InstallScript MSI Projects.

Syntax

SQLRTGetComponentScriptError2( szComponent, szMessage, nvErrorType, nvErrorLine, szScriptName, szTechnology, szServer, szDB );

Parameters

SQLRTGetComponentScriptError2 Parameters

Parameter

Description

szComponent

Specifies the name of the component that is associated with the script.

szMessage

Specifies the error message that the database server returned.

nvErrorType

Specifies the type of error. Valid types are:

SQL_ERROR_SCRIPT_UNABLE_OPEN_FILE—Failed to open the script file.
SQL_ERROR_SCRIPT_CONNECTION_NOT_OPEN—The specified connection is not opened.
SQL_ERROR_GET_SCHEMA_VERSION—Error while attempting to get the schema version from the target database.
SQL_ERROR_SET_SCHEMA_VERSION—Error while attempting to set the schema version to the target database.
SQL_ERROR_SCRIPT_COMMAND_ERROR—Failed to execute a SQL batch.

nvErrorLine

Specifies the line number of the error.

szScriptName

Specifies the name of the script.

szTechnology

Specifies the name of the database server product: Microsoft SQL Server, Oracle, or MySQL.

szServer

Specifies the name of the target database server.

szDB

Specifies the name of the target database catalog.

Return Values

SQLRTGetComponentScriptError Return Values

Return Value

Description

TRUE

One or more errors occurred.

FALSE

No errors occurred.

See Also