Hi Phil,

Thanks again.

Here's the trigger code. Not sure what you meant by 'log' file.

MY.TRIGGER

0001      SUBROUTINE MY.TRIGGER( TRIGGER.NAME, SCHEMA, FILE, EVENT,
TIME, NEWREC.ID, NEWREC, OLDREC.ID, OLDREC,  ASSOC, ASSOC.EVENT, COUNT,
CHAIN, CASCADE )

0002 **************************************************

0003 * define a trigger for testing reasons

0004 *

0005 **************************************************

0006 $INCLUDE SYINCLUDE COMMON                   
0007 COMMON/SQLTRIG/ AUDITFV

0008 *

0009      NEWREC<2> = "OK"

0010      RETURN




Here's the executing program.

0001      PROGRAM TEST.TRIG                                       
0002 *                                                            
0003 $INCLUDE SYINCLUDE COMMON                                    
0004 *                                                            
0005      OPEN '','JUNK.TRIG' TO JUNK.TRIG ELSE STOP 201, 'JUNK.TRIG'
0006 *                                                            
0007      RECORD = "5"                                            
0008      ID = "1"                                                
0009 *                                                            
0010      CRT OCONV( TIME(), "MTHS" )                             
0011      START.TIME = TIME()                                     
0012      FOR X = 1 TO 5000                                       
0013         IF NOT(MOD(X, 1000)) THEN CRT X                      
0014         WRITE RECORD TO JUNK.TRIG,ID                          
0015      NEXT X       
0016      END.TIME = TIME()                                       
0017      CRT OCONV( TIME(), "MTHS" )                             
0018 *                                                            
0019      DIFF = END.TIME - START.TIME                            
0020      PRINT "DIFF: ":OCONV( DIFF, "MTS" )                     
0021 *                                                            
0022 RETURN    


Results.

Without Trigger
>RUN BP TEST.TRIG
05:00:24pm    
1000          
2000          
3000          
4000          
5000          
05:00:24pm    
DIFF: 00:00:00

With Trigger
>RUN BP TEST.TRIG
05:02:07pm             
1000                   
2000                   
3000                   
4000                   
5000                   
05:02:34pm             
DIFF: 00:00:27


Comments welcomed.... :)

Regards,
Jeff Marcos

This e-mail is for the use of the intended recipient(s) only. If you
have received in error, please notify the sender immediately and delete
it. If you are not the intended recipient, you must not use, disclose or
distribute this e-mail without the author's prior permission. Corporate
Express checks all outgoing mail and accepts no liability for any loss
or damage caused by software viruses.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of phil walker
Sent: Thursday, 11 May 2006 10:41 AM
To: [email protected]
Subject: RE: [U2] How do you find out about file operation within an
index?

Jeff,

I cannot see how you can do it any quicker? The only thing you could
hope for is that IBM look at how they call they trigger subroutine,
(while they are fixing the issue with the debugger - my personal
battle...:-) ), as whatever basic code you come up with to capture the
information will be the same as what you put in the trigger. The
advantage of the trigger is that you are assured that it will be
executed....

Maybe you can check your code to see how efficient it is in doing
writes. Hopefully it is only doing the write once, and not repeatedly
doing the writes or writevs..... as this will indeed cause the trigger
to fire more than once. The other thing to do with the trigger code is
to open the 'log' file variable into common, and be very efficient in
what you are doing...

Do not take this as a criticism of your code, as without seeing it,
noone could say. But as the code is going to be called every time the
database does a write or a delete then it needs to be efficient.

Cheers,

Phil. 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jeff Marcos
Sent: Thursday, 11 May 2006 12:31 p.m.
To: [email protected]
Subject: RE: [U2] How do you find out about file operation within an
index?

Thanks for the feed back Phil, but triggers are too slow. We ran a very
simple test and found with triggers, it took 27 seconds to update 5000
records. Without a trigger it took < 1 second...

Regards,
Jeff Marcos

This e-mail is for the use of the intended recipient(s) only. If you
have received in error, please notify the sender immediately and delete
it. If you are not the intended recipient, you must not use, disclose or
distribute this e-mail without the author's prior permission. Corporate
Express checks all outgoing mail and accepts no liability for any loss
or damage caused by software viruses.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of phil walker
Sent: Thursday, 11 May 2006 9:06 AM
To: [email protected]
Subject: RE: [U2] How do you find out about file operation within an
index?

Hi,

If you are talking UV, then triggers will be the quickest option, as
this is done at the database level. You just have to make your code as
efficient as possible. Unfortunately UV does not support a select or
read trigger. When I was in development for VMARK, I argued for it but
alas I was a lone voice.....

Cheers,

Phil.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jeff Marcos
Sent: Thursday, 11 May 2006 11:01 a.m.
To: [email protected]
Subject: [U2] How do you find out about file operation within an index?

Hello all,



I'm wondering if there is a way to identify, within a file index, what
type of file operation has occurred.



Example; we have a program in an index to do some checks. We would also
like to find out, what the user is doing; delete, write, read, readu,
etc,...



Using triggers is not an option, because it just way too slow... Unless
someone could tell how to speed up triggers.



Regards,

Jeff Marcos



This e-mail is for the use of the intended recipient(s) only. If you
have received in error, please notify the sender immediately and delete
it. If you are not the intended recipient, you must not use, disclose or
distribute this e-mail without the author's prior permission. Corporate
Express checks all outgoing mail and accepts no liability for any loss
or damage caused by software viruses.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to