Skip to main content
Hi - as ive mentioned in previous threads, I just switched from unidata to universe.  A coworker mentioned a trigger but I do not see a version of my unidata commands:

CREATE-TRIGGER, LIST-TRIGGER, DELETE-TRIGGER

I do see the LIST.SICA command, which lists universe triggers on SQL files....do we not have triggers on regular PICK files in universe?

------------------------------
Kathleen Hambrick
Programmer at Colwell
------------------------------
Anyone,

re. "Debugging code that writes to files with triggers is a pain. We're on UV10.3.4 but have played with UV11.2 and it's still the same."

With the advent of @IDX.IOTYPE, is there any advantage to using formal UV Triggers instead of an index (usually with NO.NULLS) subroutine instead, as discussed earlier in this thread?


------------------------------
Chuck Stevenson
DBA / SW Developer
Pomeroy
US
------------------------------
Hi Chuck,
Thanks for the @IDX.IOTYPE tip. Looking forward to upgrade day when we can start using it.
Cheers,
Peter
------------------------------------------------------------------------------- Note: This email (inc all attachments) is for the use of the intended recipient(s) only. Privileged or confidential information may be contained in this communication. If you have received this email in error, please notify the sender immediately and then delete all copies of this message from your computer network. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this email without the author's prior permission. If you are the intended recipient and you do not wish to receive similar electronic messages from us in future, then please respond to the sender to this effect. We have taken precautions to minimise the risk of transmitting software viruses, but advise you to carry out your own virus checks on this email and its attachments. We do not accept liability for any loss or damage caused by software viruses and do not represent that this transmission is free from viruses or other defects. Firstmac Limited (ABN 59 094 145 963) (AFSL 290600)

Chuck,

I am by no means a trigger or an indexing expert, so while I have found this discussion extremely educational, some if the items went a little beyond by skill level. I apologize ahead of time if the answer to my question was already covered and I either missed it or just plain didn’t understand.

From what I can gather, a trigger-based program gets ‘fired’ when a file gets updated (or whatever condition is defined in the trigger), while an index-based program would get run when the index itself gets updated. What then happens when/if I have to clear the indices on a file and rebuild them? Won’t that rerun the program if it’s index-based and double-up on whatever that program was supposed to do?

Brian
For indexes the index-based program gets called whenever the record is updated.  It needs the subroutine's result to decide whether to update the index or not.
For ADD it is called with the new version of the record & adds values to the index files accordingly.
For DEL it is called with the old version of the record & deletes values from the index accordingly.
For UPD it is called 2x,  once with the old, then with the new version of the record,  the results are compared to know if any index needs to be fixed.

@IDX.IOTYPE lets the subroutine know which kind of operation is it currently being asked to perform.  That helps us programmers trick it into acting like a trigger (say spawning another phantom, or sending escalation notices,  logging something, whatever)  instead of actually indexing.

One can envision performance problems,  but with modern hardware,  I have yet to hit that wall.​

------------------------------
Chuck Stevenson
DBA / SW Developer
Pomeroy
US
------------------------------
Hi Chuck,
Thanks for the @IDX.IOTYPE tip. Looking forward to upgrade day when we can start using it.
Cheers,
Peter
------------------------------------------------------------------------------- Note: This email (inc all attachments) is for the use of the intended recipient(s) only. Privileged or confidential information may be contained in this communication. If you have received this email in error, please notify the sender immediately and then delete all copies of this message from your computer network. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this email without the author's prior permission. If you are the intended recipient and you do not wish to receive similar electronic messages from us in future, then please respond to the sender to this effect. We have taken precautions to minimise the risk of transmitting software viruses, but advise you to carry out your own virus checks on this email and its attachments. We do not accept liability for any loss or damage caused by software viruses and do not represent that this transmission is free from viruses or other defects. Firstmac Limited (ABN 59 094 145 963) (AFSL 290600)
One last thing I meant to mention earlier:
The primary record's write, and any index updates and any updates explicitly made by a trigger or index subroutine are all under on logical transaction.  They either all happen,  or none of them.

------------------------------
Chuck Stevenson
DBA / SW Developer
Pomeroy
US
------------------------------