In December 2005, "Frank" <fmor...@yahoo.com> asked:
>I'm just trying to update a table and it's giving me the following
>errors:
>668: System command cannot be executed.
>255: Not in transaction.
Back in December, people partially identified the problem - there was a
stored procedure called from a trigger that used the SYSTEM statement
and the SYSTEM statement was failing in some way.
However, I ran across the problem again today, in a marginally
different form, and realized that the problem was in part a misleading
error message (668).
Consider the stored procedure that follows:
CREATE PROCEDURE exitfail(i INTEGER DEFAULT 0)
DEFINE cmd VARCHAR(20); DEFINE n VARCHAR(12);
LET n = i;
LET cmd = "exit " || TRIM(n);
SYSTEM cmd;
END PROCEDURE;
* If you run it with no argument or with argument 0, you get success.
* If you run it with argument 1, you get SQL -668 "System command
cannot be executed" and ISAM -1 "Not owner".
* If you run it with argument 255, you get SQL -668 and ISAM -255 "Not
in transaction".
* In other words, choose your poison error message!
The problem is not that the system command cannot be executed, but
that the command executed and returned a non-zero exit status.
This is the top part of the PTS Bug number B176705. For the time
being, you should be aware that error 668 could be better phrased as
"System command cannot be executed or exited with non-zero status".