Executing the SYSTEM statement on Windows
On Windows™ systems, any SYSTEM statements in an SPL routine are executed only if the current user who is executing the SPL routine has logged on with a password.
The database server must have the password and login name of the user in order to execute a command on behalf of that user.
The first SYSTEM statement in the following example of an SPL routine
causes Windows to send an
error message to a temporary file and to put the message in a system
log that is sorted alphabetically. The second SYSTEM statement causes
the operating system to delete the temporary file:
CREATE PROCEDURE test_proc() ... SYSTEM 'type errormess101 > %tmp%tmpfile.txt | sort >> %SystemRoot%systemlog.txt'; SYSTEM 'del %tmp%tmpfile.txt'; ... END PROCEDURE; --test_proc
The expressions that follow the SYSTEM statements in this example contain variables %tmp% and %SystemRoot% that are defined by Windows.