Show TOC Entering content frame

Function documentation SQL command Locate the document in its SAP Library structure

Use

This command is used to run SQL scripts, created by SAP on databases on the target machine.

Integration

This comand is related to adding a file to an Upgrade Unit. The script that needs to be run must be added as a file to the Upgrade Unit, if it is not already present on the target machine. The target path must also be set to the path mentioned in this command.

Activities

From the Add SQL Command window:

 

·        The user indicates a Name for the command.

·        The user selects the database on which this command will be executed. Typically, this database corresponds to the User database on the mobile client. In this case, choose User from the list.

·        The user specifies the path where the SQL script file is located on the mobile client.

Note

Avoid using absolute paths to specify the SQL script path. This is because upgrades would then depend on the exact mobile client path which be different if mobile clients have different installation root paths. Instead, use a variable that contains a predefined path. For more information see Predefined Path Variables.

·        The system executes the script on the mobile client using the OSQL.exe component (one of the SQL Server tools). The login parameters for the database on which this script is picked up from the registry of the mobile client. The registry keys under the key  HKEY_LOCAL_MACHINE\software\SAP\MSA\MW\security  are created by the installation and contain the DSN, login and password of the User database(IDES).

·        After the SQL script is executed on the mobile client, an output file containing the log of the script is generated by the OSQL.exe component. This log file is created in the same folder of the SQL script file. The log file can be viewed to check if any errors occurred during the execution of the script. The log file will have the naming convention <Name of Sql Script file>_output.txt.

Example

If the name of the executed SQL script file is ExecTableIndexScript.txt then the output file is ExecTableIndexScript.txt_Output.txt. Typically, if there are no errors, the file contains numbers that look like this "1> 2> 3> 4> 5> 6> 7> 8> 9> 1> 2>".

See also:

 

Working with Commands

Leaving content frame