Re: SYSTEM call from trigger error
Posted in 1998
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Triggers, Constraints & Referential Integrity
On Mon, 01 Jun 1998 17:56:25 +0100, Paul Watson <watson@mcmail.com>
wrote:
> Can you post the trigger/p[rocedure code you are using
Here is the dbaccess code that puts everything together.
-----8<-------------8<----------------
drop table fred;
create table fred
(
field1 integer,
field2 char(20),
field3 smallint,
field4 smallint
);
-- Here is the stored procedure. Pretty straightforward
drop procedure update_fred;
create procedure update_fred()
set debug file to 'FRED.bug'; trace on;
system '/tmp/hello.4ge >> /tmp/trig.out';
trace off;
end procedure;
-- Here is the trigger. It fires on an insert
create trigger upd_fred
insert on fred referencing new as post
for each row (
execute procedure update_fred());
insert into fred
values (0,"zero",1,2);-----8<-------------8<----------------
Here is the listing for hello.4ge
{ compile with c4gl and place it in /tmp }
database barney
main
update fred
set (field3, field4) = (33,44)
end main
=============================================
When we run all this, we get
688: System command cannotbe executed.
172: ISAM error: Unexpected internal error
PS I re-tried it just calling a simple shell script and it worked
fine. (I changed the SYSTEM call in the update_fred()
to call /tmp/hello.sh which just contained an echo command.
It worked fine, so I know that permissions were okay.
Next, I wondered if the environment for Online was confused
about running .4ge programs, so I changed the SYSTEM call
to call /tmp/heelo.4ge which just contained a display "Hello"
call, and it worked fine.
When I tried to make the .4ge do a simple count(*), it blew up.