SYSTEM

Use the SYSTEM statement to issue an operating-system command from within an SPL routine.

Syntax


1  SYSTEM
1 expression
1 SPL_var
2  ;
Element Description Restrictions Syntax
expression Evaluates to a user-executable operating-system command You cannot specify that the command run in the background Operating-system dependent
SPL_var SPL variable containing a command Must be of a character data type Identifier;

Usage

If the specified expression is not a character expression, it is converted to a character expression and passed to the operating system for execution.

The command that SYSTEM specifies cannot run in the background. The database server waits for the operating system to complete execution of the command before it continues to the next statement in the SPL routine. The SPL routine cannot use any returned values from the command.

If the operating-system command fails (that is, returns a nonzero status for the command), an exception is raised that contains the returned operating-system status as the ISAM error code and an appropriate SQL error code.

A rollback does not terminate a system call, so a suspended transaction can wait indefinitely for the call to return. For instructions on recovery from a deadlock during a long transaction rollback, see the HCL OneDB™ Administrator's Guide.

The dynamic log feature of HCL OneDB automatically adds log files until the long transaction completes or rolls back successfully.

In DBA- and owner-privileged SPL routines that contain SYSTEM statements, the command runs with the access privileges of the user who executes the routine.