RE: [U2] Triggers docs?

2005-03-13 Thread Dan Fitzgerald
Martin - I appreciate it, but I didn't see an attachment...

Our greatest duty in this life is to help others. And please, if you can't 
help them, could you at least not hurt them? - H.H. the Dalai Lama
When buying  selling are controlled by legislation, the first thing to be 
bought  sold are the legislators - P.J. O'Rourke
Dan Fitzgerald



From: Martin Canty [EMAIL PROTECTED]
Reply-To: u2-users@listserver.u2ug.org
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?
Date: Fri, 11 Mar 2005 22:47:35 -0800
Hi Dan,
Attached is a document I wrote (for our monthly newsletter) to use
triggers. The example is to trap record corruption, there is coding for
both UniData  UniVerse. We found the culprit within 10 minutes of
implementing the trigger!
There is a cost to using triggers though I measured it on UniData 5
 found that an update with a trigger took something like 10 times
longer than an index based trigger (though the real trigger is so much
more functionally rich!)
Martin

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Friday, March 11, 2005 10:15 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Triggers docs?
The manual is a bit skimpy on triggers. Any supplemetal docs around?
We're trying to track updates to a file; individual items have gone
missing lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
The information contained in this email is strictly confidential and for
the
use of the addressee only, unless otherwise indicated. If you are not
the
intended recipient, please do not read, copy, use or disclose to others
this
message or any attachment. Please also notify the sender by replying to
this
email or by telephone +44 (0)20 7896 0011 and then delete the email and
any
copies of it. Opinions, conclusions (etc.) that do not relate to the
official business of this company shall be understood as neither given
nor
endorsed by it.  IG Markets Limited and IG Index Plc are authorised and
regulated by the Financial Services Authority and, in Australia, by the
Australian Securities and Investments Commission.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
[demime 1.01d removed an attachment of type application/msword which had a 
name of U2 Triggers.doc]
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Triggers docs?

2005-03-13 Thread Moderator
Dan,
   You won't see an attachment. Our list filters out attachments to 
minimize the risk of virii and trojans.

   - Charles Barouch, Moderator
Dan Fitzgerald wrote:
Martin - I appreciate it, but I didn't see an attachment...
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Triggers docs?

2005-03-13 Thread Dan Fitzgerald
Ah. I'd forgotten about the filtering. So, Martin, if you get a chance, a 
direct email? Thanks.

...although in this particular instance, I think I've seen enough. 
Fortunately, all sanctioned updates occur via a standard update subroutine, 
so we'll just go with that. A manager had come across the word triggers, 
so I had to do some due diligence.

Didn't there used to be a place to contribute and read docs? I poked around 
a bit, and didn't find one.



Our greatest duty in this life is to help others. And please, if you can't 
help them, could you at least not hurt them? - H.H. the Dalai Lama
When buying  selling are controlled by legislation, the first thing to be 
bought  sold are the legislators - P.J. O'Rourke
Dan Fitzgerald



From: Moderator [EMAIL PROTECTED]
Reply-To: u2-users@listserver.u2ug.org
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Triggers docs?
Date: Sun, 13 Mar 2005 14:58:53 -0500
Dan,
   You won't see an attachment. Our list filters out attachments to 
minimize the risk of virii and trojans.

   - Charles Barouch, Moderator
Dan Fitzgerald wrote:
Martin - I appreciate it, but I didn't see an attachment...
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-13 Thread Ross Ferris
Maybe/and also on the wiki

Ross Ferris
Stamina Software
Visage  an Evolution in Software Development

-Original Message-
From: [EMAIL PROTECTED] [mailto:owner-u2-
[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Monday, 14 March 2005 7:36 AM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Triggers docs?

Ah. I'd forgotten about the filtering. So, Martin, if you get a chance, a
direct email? Thanks.

...although in this particular instance, I think I've seen enough.
Fortunately, all sanctioned updates occur via a standard update subroutine,
so we'll just go with that. A manager had come across the word triggers,
so I had to do some due diligence.

Didn't there used to be a place to contribute and read docs? I poked around
a bit, and didn't find one.





Our greatest duty in this life is to help others. And please, if you can't
help them, could you at least not hurt them? - H.H. the Dalai Lama
When buying  selling are controlled by legislation, the first thing to be
bought  sold are the legislators - P.J. O'Rourke
Dan Fitzgerald




From: Moderator [EMAIL PROTECTED]
Reply-To: u2-users@listserver.u2ug.org
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Triggers docs?
Date: Sun, 13 Mar 2005 14:58:53 -0500

Dan,
You won't see an attachment. Our list filters out attachments to
minimize the risk of virii and trojans.

- Charles Barouch, Moderator

Dan Fitzgerald wrote:

Martin - I appreciate it, but I didn't see an attachment...
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.2 - Release Date: 11/03/2005


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.2 - Release Date: 11/03/2005
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


[U2] Triggers docs?

2005-03-11 Thread Dan Fitzgerald
The manual is a bit skimpy on triggers. Any supplemetal docs around?
We're trying to track updates to a file; individual items have gone missing 
lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-11 Thread David Scoggins
I used this post by Bryan Thorell as a starting point when I set them up for
the first time.  BTW, Thanks Bryan!

http://www.indexinfocus.com/dl/u2list/200210/40372.html

 -Original Message-
 From: Dan Fitzgerald [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 11, 2005 10:15 AM
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Triggers docs?
 
 
 The manual is a bit skimpy on triggers. Any supplemetal docs around?
 
 We're trying to track updates to a file; individual items 
 have gone missing 
 lately. No SQL involvement at all.
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-11 Thread Jay Falck
Dan,

I haven't found any additional documentation but I have come across a
serious gotcha. Once you add a trigger to a file it is a SQL file. There is
no going back short of creating a new table. This makes it difficult to move
data between INDIAN's (sp?). I have been unable, even using FORMAT.CONVERT
to move data from an AIX box to Windows.

If someone else has managed to get this to work, I'd appreciate the info.

Jay

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Friday, March 11, 2005 12:15 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Triggers docs?

The manual is a bit skimpy on triggers. Any supplemetal docs around?

We're trying to track updates to a file; individual items have gone missing 
lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Triggers docs?

2005-03-11 Thread Jeffrey Butera
 The manual is a bit skimpy on triggers. Any supplemetal docs around?

 We're trying to track updates to a file; individual items have gone missing
 lately. No SQL involvement at all.

Sorry, can't comment on Universe.

For unidata,  here's some brief docs I wrote after digging.  I found info in
'Developing UniBasic Applications'

A trigger is a piece of code (subroutine) that is executed when one of two 
things happens: a record is written (updated) or a record is deleted. These 
two event are separate, that is, the subroutine to execute in each case may 
be different.

Some Unidata trigger commands:

LIST.TRIGGER filename
CREATE.TRIGGER filename subroutine_name UPDATE
CREATE.TRIGGER filename subroutine_name DELETE
DELETE.TRIGGER filename UPDATE
DELETE.TRIGGER filename DELETE

Some trigger notes:

   1. Subroutines for triggers must be globally cataloged. That is:

:CATALOG subroutine_name 

   2. Triggers may only be created/manipulated by the owner of the file at the 
operating system level or have root permissions on UniData.

What you use a trigger subroutine to do is up to you. Here's a sample 
template:

SUBROUTINE subroutine_name(X.EXECSTAT,X.DICT,X.FILE,X.ID,X.REC)
*
* This subroutine MUST BE GLOBALLY CATALOGed!
* JVB Jeff Butera
* H08 Hampshire College
*
* EXECSTAT=2 says to allow the record to be written (when we exit
* this subroutine) but use the record as in X.REC (ie: we may manipulate
* it in this subroutine and it'll use the edited copy, not the original)
*
X.EXECSTAT=2

After that, you're free to do whatever you like in native Unibasic. The 
variable X.REC contains the entire record to be written to the database file 
X.FILE with the ID X.ID. The EXECSTAT variable, when set to 2, allows you to 
possibly manipulate the record in this subroutine before the record is 
updated/deleted.



-- 
Jeff Butera, Ph.D.
Administrative Systems
Hampshire College
[EMAIL PROTECTED]
413-559-5556

There are 10 kinds of people in the world: those that
  understand binary and those that don't.Various 
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-11 Thread Scott Ballinger
Here is link that might be helpful: (works for both UV  UD)

http://www.mindspring.com/~tpackert/unidata_tricks.htm

I have used the index-trigger method to track and record all changes to
a file. It seems to work well; the performance hit has been negligible.
If anyone is interested I will post the code. The only gotcha was
figuring out how many times the TRIGGER subroutine was called, and what
my RECord variable contained each time. Here is the note at the top of
the subroutine regarding this:

SUBROUTINE SAVE.CHANGES.MYFILE(ANS,REC,ID)
* This subroutine is called from the 'TRIGGER' I-Type in dict MYFILE.
* A secondary index on MYFILE is defined on 'TRIGGER' using the NO.NULLS
option.
* That forces this subroutine to be called twice when a MYFILE record is
updated:
*  the first time with REC = the original record, then again with REC =
the new
*  record (however, if the MYFILE record is new, this subroutine is
called only once).

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Friday, March 11, 2005 10:15 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Triggers docs?


The manual is a bit skimpy on triggers. Any supplemetal docs around?

We're trying to track updates to a file; individual items have gone
missing 
lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-11 Thread Adrian Matthews
How do you track a record being deleted from the file though?

The real trigger mechanism fires with INSERT, UPDATE or DELETE.

If memory serves this type of pseudo-trigger can't differentiate between
a delete and an insert/update.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
Sent: 11 March 2005 20:37
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?

Here is link that might be helpful: (works for both UV  UD)

http://www.mindspring.com/~tpackert/unidata_tricks.htm

I have used the index-trigger method to track and record all changes to
a file. It seems to work well; the performance hit has been negligible.
If anyone is interested I will post the code. The only gotcha was
figuring out how many times the TRIGGER subroutine was called, and what
my RECord variable contained each time. Here is the note at the top of
the subroutine regarding this:

SUBROUTINE SAVE.CHANGES.MYFILE(ANS,REC,ID)
* This subroutine is called from the 'TRIGGER' I-Type in dict MYFILE.
* A secondary index on MYFILE is defined on 'TRIGGER' using the NO.NULLS
option.
* That forces this subroutine to be called twice when a MYFILE record is
updated:
*  the first time with REC = the original record, then again with REC =
the new
*  record (however, if the MYFILE record is new, this subroutine is
called only once).

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Friday, March 11, 2005 10:15 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Triggers docs?


The manual is a bit skimpy on triggers. Any supplemetal docs around?

We're trying to track updates to a file; individual items have gone
missing 
lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


The information contained in this email is strictly confidential and for the 
use of the addressee only, unless otherwise indicated. If you are not the 
intended recipient, please do not read, copy, use or disclose to others this 
message or any attachment. Please also notify the sender by replying to this 
email or by telephone +44 (0)20 7896 0011 and then delete the email and any 
copies of it. Opinions, conclusions (etc.) that do not relate to the official 
business of this company shall be understood as neither given nor endorsed by 
it.  IG Markets Limited and IG Index Plc are authorised and regulated by the 
Financial Services Authority and, in Australia, by the Australian Securities 
and Investments Commission.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-11 Thread Scott Ballinger
The trigger is normally called twice: the first time you get the
original @RECORD, the second time the new @RECORD. If an item is new or
being deleted, then the trigger is called only once. I use named common
to track of where I am and to save old @RECORD, so that I can test: if
this is not a new item, and old @RECORD is null, then this must be a
delete.

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian Matthews
Sent: Friday, March 11, 2005 1:28 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?


How do you track a record being deleted from the file though?

The real trigger mechanism fires with INSERT, UPDATE or DELETE.

If memory serves this type of pseudo-trigger can't differentiate between
a delete and an insert/update.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
Sent: 11 March 2005 20:37
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?

Here is link that might be helpful: (works for both UV  UD)

http://www.mindspring.com/~tpackert/unidata_tricks.htm

I have used the index-trigger method to track and record all changes to
a file. It seems to work well; the performance hit has been negligible.
If anyone is interested I will post the code. The only gotcha was
figuring out how many times the TRIGGER subroutine was called, and what
my RECord variable contained each time. Here is the note at the top of
the subroutine regarding this:

SUBROUTINE SAVE.CHANGES.MYFILE(ANS,REC,ID)
* This subroutine is called from the 'TRIGGER' I-Type in dict MYFILE.
* A secondary index on MYFILE is defined on 'TRIGGER' using the NO.NULLS
option.
* That forces this subroutine to be called twice when a MYFILE record is
updated:
*  the first time with REC = the original record, then again with REC =
the new
*  record (however, if the MYFILE record is new, this subroutine is
called only once).

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Friday, March 11, 2005 10:15 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Triggers docs?


The manual is a bit skimpy on triggers. Any supplemetal docs around?

We're trying to track updates to a file; individual items have gone
missing 
lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


The information contained in this email is strictly confidential and for
the use of the addressee only, unless otherwise indicated. If you are
not the intended recipient, please do not read, copy, use or disclose to
others this message or any attachment. Please also notify the sender by
replying to this email or by telephone +44 (0)20 7896 0011 and then
delete the email and any copies of it. Opinions, conclusions (etc.) that
do not relate to the official business of this company shall be
understood as neither given nor endorsed by it.  IG Markets Limited and
IG Index Plc are authorised and regulated by the Financial Services
Authority and, in Australia, by the Australian Securities and
Investments Commission.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-11 Thread Jay Falck
I used the pseudo-trigger method in UV 9.6. Although you cannot tell a
DELETE during the trigger firing I did determine the DELETE status during
log file processing by doing a read of the file. If no record was found I
new it was a deleted record.

Jay

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian Matthews
Sent: Friday, March 11, 2005 3:28 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?

How do you track a record being deleted from the file though?

The real trigger mechanism fires with INSERT, UPDATE or DELETE.

If memory serves this type of pseudo-trigger can't differentiate between
a delete and an insert/update.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
Sent: 11 March 2005 20:37
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?

Here is link that might be helpful: (works for both UV  UD)

http://www.mindspring.com/~tpackert/unidata_tricks.htm

I have used the index-trigger method to track and record all changes to
a file. It seems to work well; the performance hit has been negligible.
If anyone is interested I will post the code. The only gotcha was
figuring out how many times the TRIGGER subroutine was called, and what
my RECord variable contained each time. Here is the note at the top of
the subroutine regarding this:

SUBROUTINE SAVE.CHANGES.MYFILE(ANS,REC,ID)
* This subroutine is called from the 'TRIGGER' I-Type in dict MYFILE.
* A secondary index on MYFILE is defined on 'TRIGGER' using the NO.NULLS
option.
* That forces this subroutine to be called twice when a MYFILE record is
updated:
*  the first time with REC = the original record, then again with REC =
the new
*  record (however, if the MYFILE record is new, this subroutine is
called only once).

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Friday, March 11, 2005 10:15 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Triggers docs?


The manual is a bit skimpy on triggers. Any supplemetal docs around?

We're trying to track updates to a file; individual items have gone
missing 
lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


The information contained in this email is strictly confidential and for the
use of the addressee only, unless otherwise indicated. If you are not the
intended recipient, please do not read, copy, use or disclose to others this
message or any attachment. Please also notify the sender by replying to this
email or by telephone +44 (0)20 7896 0011 and then delete the email and any
copies of it. Opinions, conclusions (etc.) that do not relate to the
official business of this company shall be understood as neither given nor
endorsed by it.  IG Markets Limited and IG Index Plc are authorised and
regulated by the Financial Services Authority and, in Australia, by the
Australian Securities and Investments Commission.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-11 Thread Scott Ballinger
I should think a little longer before pressing send... It's not that
easy to catch a delete using this kind of trigger. You can test for a
new record by trying to read it, if it's not there then this is a new
update. But since the trigger is called only once for a delete, it gets
pretty ugly to trap for this condition. The best answer I can come up
with on a Friday afternoon is treat every first pass as a delete, then
un-do whatever you did to track the delete on the second pass (if there
is one). That is a particularly heinous solution, however. There must be
a better way to do this.

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian Matthews
Sent: Friday, March 11, 2005 1:28 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?


How do you track a record being deleted from the file though?

The real trigger mechanism fires with INSERT, UPDATE or DELETE.

If memory serves this type of pseudo-trigger can't differentiate between
a delete and an insert/update.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
Sent: 11 March 2005 20:37
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?

Here is link that might be helpful: (works for both UV  UD)

http://www.mindspring.com/~tpackert/unidata_tricks.htm

I have used the index-trigger method to track and record all changes to
a file. It seems to work well; the performance hit has been negligible.
If anyone is interested I will post the code. The only gotcha was
figuring out how many times the TRIGGER subroutine was called, and what
my RECord variable contained each time. Here is the note at the top of
the subroutine regarding this:

SUBROUTINE SAVE.CHANGES.MYFILE(ANS,REC,ID)
* This subroutine is called from the 'TRIGGER' I-Type in dict MYFILE.
* A secondary index on MYFILE is defined on 'TRIGGER' using the NO.NULLS
option.
* That forces this subroutine to be called twice when a MYFILE record is
updated:
*  the first time with REC = the original record, then again with REC =
the new
*  record (however, if the MYFILE record is new, this subroutine is
called only once).

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Friday, March 11, 2005 10:15 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Triggers docs?


The manual is a bit skimpy on triggers. Any supplemetal docs around?

We're trying to track updates to a file; individual items have gone
missing 
lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


The information contained in this email is strictly confidential and for
the use of the addressee only, unless otherwise indicated. If you are
not the intended recipient, please do not read, copy, use or disclose to
others this message or any attachment. Please also notify the sender by
replying to this email or by telephone +44 (0)20 7896 0011 and then
delete the email and any copies of it. Opinions, conclusions (etc.) that
do not relate to the official business of this company shall be
understood as neither given nor endorsed by it.  IG Markets Limited and
IG Index Plc are authorised and regulated by the Financial Services
Authority and, in Australia, by the Australian Securities and
Investments Commission.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-11 Thread Adrian Matthews
Must be a Unidata thing. It only gets called once on Universe.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
Sent: 11 March 2005 22:29
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?

The trigger is normally called twice: the first time you get the
original @RECORD, the second time the new @RECORD. If an item is new or
being deleted, then the trigger is called only once. I use named common
to track of where I am and to save old @RECORD, so that I can test: if
this is not a new item, and old @RECORD is null, then this must be a
delete.

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian Matthews
Sent: Friday, March 11, 2005 1:28 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?


How do you track a record being deleted from the file though?

The real trigger mechanism fires with INSERT, UPDATE or DELETE.

If memory serves this type of pseudo-trigger can't differentiate between
a delete and an insert/update.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
Sent: 11 March 2005 20:37
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?

Here is link that might be helpful: (works for both UV  UD)

http://www.mindspring.com/~tpackert/unidata_tricks.htm

I have used the index-trigger method to track and record all changes to
a file. It seems to work well; the performance hit has been negligible.
If anyone is interested I will post the code. The only gotcha was
figuring out how many times the TRIGGER subroutine was called, and what
my RECord variable contained each time. Here is the note at the top of
the subroutine regarding this:

SUBROUTINE SAVE.CHANGES.MYFILE(ANS,REC,ID)
* This subroutine is called from the 'TRIGGER' I-Type in dict MYFILE.
* A secondary index on MYFILE is defined on 'TRIGGER' using the NO.NULLS
option.
* That forces this subroutine to be called twice when a MYFILE record is
updated:
*  the first time with REC = the original record, then again with REC =
the new
*  record (however, if the MYFILE record is new, this subroutine is
called only once).

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Friday, March 11, 2005 10:15 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Triggers docs?


The manual is a bit skimpy on triggers. Any supplemetal docs around?

We're trying to track updates to a file; individual items have gone
missing 
lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


The information contained in this email is strictly confidential and for
the use of the addressee only, unless otherwise indicated. If you are
not the intended recipient, please do not read, copy, use or disclose to
others this message or any attachment. Please also notify the sender by
replying to this email or by telephone +44 (0)20 7896 0011 and then
delete the email and any copies of it. Opinions, conclusions (etc.) that
do not relate to the official business of this company shall be
understood as neither given nor endorsed by it.  IG Markets Limited and
IG Index Plc are authorised and regulated by the Financial Services
Authority and, in Australia, by the Australian Securities and
Investments Commission.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


The information contained in this email is strictly confidential and for the 
use of the addressee only, unless otherwise indicated. If you are not the 
intended recipient, please do not read, copy, use or disclose to others this 
message or any attachment. Please also notify the sender by replying to this 
email or by telephone +44 (0)20 7896 0011 and then delete the email and any 
copies of it. Opinions, conclusions (etc.) that do not relate to the official 
business of this company shall be understood as neither given nor endorsed by 
it.  IG Markets Limited and IG Index Plc are authorised and regulated by the 
Financial Services Authority and, in Australia, by the Australian Securities 
and Investments Commission.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-11 Thread Adrian Matthews
I think this must be something to do with why proper triggers impose
such a load on a universe system. It has to check for deletes using some
internal mechanism.

Mind you the replication in Universe imposes very little load and that
track deletes as well

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
Sent: 11 March 2005 22:55
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?

I should think a little longer before pressing send... It's not that
easy to catch a delete using this kind of trigger. You can test for a
new record by trying to read it, if it's not there then this is a new
update. But since the trigger is called only once for a delete, it gets
pretty ugly to trap for this condition. The best answer I can come up
with on a Friday afternoon is treat every first pass as a delete, then
un-do whatever you did to track the delete on the second pass (if there
is one). That is a particularly heinous solution, however. There must be
a better way to do this.

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian Matthews
Sent: Friday, March 11, 2005 1:28 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?


How do you track a record being deleted from the file though?

The real trigger mechanism fires with INSERT, UPDATE or DELETE.

If memory serves this type of pseudo-trigger can't differentiate between
a delete and an insert/update.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
Sent: 11 March 2005 20:37
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Triggers docs?

Here is link that might be helpful: (works for both UV  UD)

http://www.mindspring.com/~tpackert/unidata_tricks.htm

I have used the index-trigger method to track and record all changes to
a file. It seems to work well; the performance hit has been negligible.
If anyone is interested I will post the code. The only gotcha was
figuring out how many times the TRIGGER subroutine was called, and what
my RECord variable contained each time. Here is the note at the top of
the subroutine regarding this:

SUBROUTINE SAVE.CHANGES.MYFILE(ANS,REC,ID)
* This subroutine is called from the 'TRIGGER' I-Type in dict MYFILE.
* A secondary index on MYFILE is defined on 'TRIGGER' using the NO.NULLS
option.
* That forces this subroutine to be called twice when a MYFILE record is
updated:
*  the first time with REC = the original record, then again with REC =
the new
*  record (however, if the MYFILE record is new, this subroutine is
called only once).

Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Friday, March 11, 2005 10:15 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Triggers docs?


The manual is a bit skimpy on triggers. Any supplemetal docs around?

We're trying to track updates to a file; individual items have gone
missing 
lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


The information contained in this email is strictly confidential and for
the use of the addressee only, unless otherwise indicated. If you are
not the intended recipient, please do not read, copy, use or disclose to
others this message or any attachment. Please also notify the sender by
replying to this email or by telephone +44 (0)20 7896 0011 and then
delete the email and any copies of it. Opinions, conclusions (etc.) that
do not relate to the official business of this company shall be
understood as neither given nor endorsed by it.  IG Markets Limited and
IG Index Plc are authorised and regulated by the Financial Services
Authority and, in Australia, by the Australian Securities and
Investments Commission.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


The information contained in this email is strictly confidential and for the 
use of the addressee only, unless otherwise indicated. If you are not the 
intended recipient, please do not read, copy, use or disclose to others this 
message or any attachment. Please also notify the sender by replying to this 
email or by telephone +44 (0)20 7896 0011 and then delete the email and any 
copies of it. Opinions, conclusions (etc.) that do not relate to the official 
business of this company shall be understood as neither given nor endorsed by 
it.  IG Markets Limited and IG Index Plc are authorised and regulated by the 
Financial Services Authority

RE: [U2] Triggers docs?

2005-03-11 Thread Martin Canty
Hi Dan,

Attached is a document I wrote (for our monthly newsletter) to use
triggers. The example is to trap record corruption, there is coding for
both UniData  UniVerse. We found the culprit within 10 minutes of
implementing the trigger!

There is a cost to using triggers though I measured it on UniData 5
 found that an update with a trigger took something like 10 times
longer than an index based trigger (though the real trigger is so much
more functionally rich!)


Martin



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Fitzgerald
Sent: Friday, March 11, 2005 10:15 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Triggers docs?


The manual is a bit skimpy on triggers. Any supplemetal docs around?

We're trying to track updates to a file; individual items have gone
missing lately. No SQL involvement at all.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


The information contained in this email is strictly confidential and for
the
use of the addressee only, unless otherwise indicated. If you are not
the
intended recipient, please do not read, copy, use or disclose to others
this
message or any attachment. Please also notify the sender by replying to
this
email or by telephone +44 (0)20 7896 0011 and then delete the email and
any
copies of it. Opinions, conclusions (etc.) that do not relate to the
official business of this company shall be understood as neither given
nor
endorsed by it.  IG Markets Limited and IG Index Plc are authorised and
regulated by the Financial Services Authority and, in Australia, by the
Australian Securities and Investments Commission.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

[demime 1.01d removed an attachment of type application/msword which had a name 
of U2 Triggers.doc]
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Triggers docs?

2005-03-11 Thread Ken Wallis
Scott Ballinger wrote:

 The trigger is normally called twice: the first time you get the
 original @RECORD, the second time the new @RECORD. If an item
 is new or
 being deleted, then the trigger is called only once. I use
 named common
 to track of where I am and to save old @RECORD, so that I can test: if
 this is not a new item, and old @RECORD is null, then this must be a
 delete.

Scott said in an earlier post that he was talking about a pseudo-trigger
implemented by creating a secondary index on a SUBR I-type.

It may well be that such index routines are called twice, but real TRIGGERs
aren't.  Certainly on UniData they're not.

Cheers,

Ken
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/