Re: SYSTEM call from trigger error
Posted in 1998
So now that the system command works with a shell script what if you
change it to:
system '/tmp/hello.sh >> /tmp/trig.out';
and create the hello.sh to first set up an appropriate environement
and then execute /tmp/hello.4ge.
If that works your environement is wrong when you simply run the .4ge
directly. Running it via a shell script like this may be slightly
slower, but if it works it might be acceptable. Otherwise you will
have to find a way to make sure the environement for that 4GL program
is correct when executed directly. I don't know how to do that, or if
it's even possible.
On Mon, 01 Jun 1998 22:21:57 GMT, jonatho@catalinaltg.com (Jonathan
Oei) wrote:
>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.
>
>
Nils Myklebust
NM Data AS
Norway
E-mail: Nils.Myklebust@nmdata.com
FAQ at: http://www.iiug.org/techinfo/faq/faq_top.html
(Now with ODBC info under "Third party products".)