triggers

MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

triggers

Post by MiniMe »

I have a table that has a trigger on it so that when a record is deleted from the table it is transfered to another table. Is there a way to allow a vortex script to override the trigger so that under certain conditions its not triggered...

M.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

triggers

Post by John »

You can issue the following SQL to prevent triggers from being run.

<SQL "set options='triggers'"></SQL>

This should obviously be done with care to prevent unintended consequences.
John Turnbull
Thunderstone Software
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

triggers

Post by MiniMe »

Weird.. I didnt see that in the documentation anywhere.. what other values does nooptions accept.
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

triggers

Post by MiniMe »

Looks to me that I can't use that feature with my version or something like that..

<!-- 100 processuploads:12: Unknown option triggers in the function set option -->
<!-- 200 processuploads:12: set nooptions='triggers'; -->
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

triggers

Post by John »

That is the only option currently known by nooptions. The error message is in error, if you have nooptions then it does know the triggers option, and it will apply.
John Turnbull
Thunderstone Software
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

triggers

Post by MiniMe »

It doesn't appear to be working in my version of Texis. I should only have to invoke it once at the beginning of the script, right??

this is my version.

Texis Web Script (Vortex) Copyright (c) 1996-2000 Thunderstone - EPI, Inc.
Commercial Version 3.01.971289085 of Oct 11, 2000 (alpha-dec-osf4.0)
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

triggers

Post by John »

It will work in that version. It will only apply to the database you are connected to. If you switch database, or issue <sqlcp cache close> then they setting will be lost.
John Turnbull
Thunderstone Software
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

triggers

Post by MiniMe »

Hmm... I put it in the script but the triggers are stilling being fired off.. here is the script.


<script language = vortex>
<db=/db/tables/maint>
<timeout = -1></timeout>

<A NAME=main>
<SQL "set nooptions='triggers'"></SQL>
<sql "select USER_ID, USER_REC from deltas">
<sum "%s
" $USER_ID $USER_REC>
<SQL ROW "delete from books where USER_ID\USER_REC = $ret"></SQL>
$loop
</sql>
</A>
</script>
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

triggers

Post by John »

I got the option reversed the first time, you have to specify it as:

<SQL "set options='triggers'"></SQL>
John Turnbull
Thunderstone Software
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

triggers

Post by MiniMe »

Should I be concerned with this error??

<!-- 100 /db/schemas/uploads:316: Unknown option triggers in the function set option -->
Post Reply