4D v16.3SQL EXECUTE SCRIPT |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
SQL EXECUTE SCRIPT
SQL EXECUTE SCRIPT
The SQL EXECUTE SCRIPT command is used to execute a series of SQL statements placed in the script file designated by scriptPath. This command can only be executed on a local machine (local 4D or stored procedure on 4D Server). It works with the current database (internal or external database). Note: This command cannot be used with an external connection that is opened directly or via ODBC. Pass the complete pathname of the text file containing the SQL statements to be executed in the scriptPath parameter. The pathname must be expressed using the syntax of the current system. If you pass an empty string ("") in scriptPath, a standard Open document dialog box will be displayed so that the user can select the script file to be executed. Note: The SQL EXPORT DATABASE and SQL EXPORT SELECTION commands automatically generate this script file. The errorAction parameter is used to configure the functioning of the command when an error occurs during script execution. You can pass one of the three following constants, placed in the SQL theme:
The attribName and attribValue parameters must be passed by pairs. These parameters are intended to be used to specify specific attributes for the script execution. In the current version of 4D, a single attribute can be passed in attribName, available via the following constant, placed in the SQL theme:
If the 4D log file is activated (via the selectors 28 or 45 of the SET DATABASE PARAMETER command), each SQL command executed will generate an entry with the following information:
If the script is executed correctly (no error occurs), the OK system variable is set to 1. In the event of an error, the OK system variable is set to 0 or not according to the errorAction parameter:
Note: If you use this command to execute memory-consuming actions such as massive data imports, you can consider calling the ALTER DATABASE SQL command in order to temporarily disable the SQL options.
|
PROPERTIES
Product: 4D HISTORY
Created: 4D v12 ARTICLE USAGE
4D Language Reference ( 4D v16) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||