Trigger problem

barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Trigger problem

Post by barry.marcus »

Texis Web Script (Vortex) Copyright (c) 1996-2010 Thunderstone - EPI, Inc.
Commercial Version 5.01.1268856485 20100317 (i686-intel-winnt-64-32)
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Trigger problem

Post by mark »

Is the vortex script that's causing the trigger running from the command line or from web access?
If from web I wonder if it's getting tricked into thinking it's in CGI mode and tripping up.
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Trigger problem

Post by barry.marcus »

It is running from web access, as CGI.
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Trigger problem

Post by barry.marcus »

Any further insight into what might be causing the error I'm seeing or what I might doing wrong?

Thanks
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Trigger problem

Post by Kai »

It looks like an issue with how triggers are executed by Texis. Try rewriting your Vortex trigger like this:

<a name=main>
<vxcp htmlmode off>
<capture>
... trigger code goes here ...
</capture>
</a>

to suppress output.
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Trigger problem

Post by barry.marcus »

Maybe I'm doing something wrong, but I'm still getting the same error. Here is my trigger code:

<script language=vortex>
<a name=main>
<db=$db>
<vxcp htmlmode off>
<capture>
<sql row "select * from " $table>
<sql novars "insert into logproject(logid, tablename, id, p_equivs, c_equivs, name) values (counter, $tbname, $id, $p_equivs, $c_equivs, $name)">
</sql>
</sql>
</capture>
</a>
</script>

The name of the file of the code above is populatelog.

Here is the trigger definition:

set triggermode=1; create trigger project_insert_T after insert on project FOR EACH ROW SHELL 'texis.exe -r db=$db table=$table tbname=project populatelog/main.txt'
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Trigger problem

Post by barry.marcus »

I also tried simplifying to this:

<script language=vortex>
<a name=main>
<vxcp htmlmode off>
<capture>
<db=$db>
<sql row "select * from " $table>
<sql novars "insert into logproject(logid, tablename, id, p_equivs, c_equivs, name) values (counter, $tbname, $id, $p_equivs, $c_equivs, $name)">
</sql>
</sql>
</capture>
</a>
</script>

Just is not working. :-(
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Trigger problem

Post by Kai »

Does it still fail with `Cannot write stdout' if you add this right after the <script language=vortex>:

<putmsg print off>

Any other errors in vortex.log?
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Trigger problem

Post by barry.marcus »

Yes, I still get the error even with the <putmsg print off> directive. No, there are no other errors in the log. Always just errors like this:

006 2010-10-04 18:48:38 populatelog: (5840) Can't write stdout: Bad file descriptor; exiting

However, the number in parens (in this case "5840") is always different.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Trigger problem

Post by mark »

The number is the process id so it's expected to vary.
Try the simplest possible trigger and supply full paths.

set triggermode=1; create trigger project_insert_T after insert on project FOR EACH ROW SHELL 'c:\morph3\texis.exe -r c:\the\dir\test/main.txt'

And ensure there are no extraneous newlines or other whitespace in the script.

<script language=vortex><a name=main></a></script>

If that doesn't give an error try adding in the needed bits one at a time to find which is causing the problem.
Post Reply