Question [resolved]database Record Creation Logging With -clientlog

altair

Member
Hi,


I would like to know if there is a way to log automatically database record creation (the way as we already have for some -clientlog -logentrytypes startup parameters).

I know it is possible with Temp-table (Progress KB - Is there a LOG-ENTRY-TYPE to log TEMP-TABLE statistics?) but for physical database record I don't know.

For example, I would have something like this :

RUN MyProcedure.

PROCEDURE MyProcedure :

CREATE MyDataBase.MyTable. /*create a physical database record*/
END PROCEDURE.

In my clientlog I would like to have something like this :

4GL 4GLTRACE Run MyProcedure [Main Block - c:\temp\p60345_Untitled1.cmp @ 4]
4GL TABLE Created TABLE MyDataBase.MyTable (ID:57 Indexes:1) MyProcedure c:\temp\p60345_Untitled1.cmp @ 7
4GL 4GLTRACE Return from MyProcedure [c:\temp\p60345_Untitled1.cmp]


(The 2nd Line, in red, is fake of course :p - I took an example on the same feature for temp-table, but it represents what I would like to have)


My initial issue is that somewhere in my code (I don't know where) I have a record creation which causes problem and I would like to identify at least the internal procedure which create this record (with line number if possible).
My code is quite heavy and contain many sub-procedure with dynamic stuff so it is not really easy. Currently my code is only client-server direct connection (no use of appserver, everything is called from Windows client side)
For info, I use Progress OpenEdge V11.5.1 on Windows XP SP2 OS.

Have you any advice ?

Thanks in advance.


Regards,
 

Cringer

ProgressTalk.com Moderator
Staff member
The create trigger may not be an easy option available. You may be able to cobble something together using the QryInfo and 4GLTrans options, but it won't be something completely clear unfortunately.
 

altair

Member
Hi, thanks for the answer.

But sadly, I can't create a trigger for that.

I have already tried the QryInfo (seems to not give any info about database table record creation) and 4GLTRANS does not give information about the nature of transaction (CREATE, UPDATE, DELETE).

For information, here is what I've tried so far as logentrytypes :
-logentrytypes dynObjects.*:4,4GLTrace:4,ProEvents.*:3,FileID,SAX:2,IgnoredOps:2,QryInfo:3,Temp-Tables:4,TTStats:4,4GLTrans:4,DS.QryInfo:4,DS.Cursor:4,DB.Connects:4


Is there any other way ?

Thanks in advance,
 

Cringer

ProgressTalk.com Moderator
Staff member
If your transactions are small (which theoretically they should be), you can combine the transaction information with the query information to find where a query for the table you're interested in is within the same scope as a transaction. It should at least help you narrow down the instances of the problem.
You should raise an enhancement request for what you're after with Progress though because I think it would make sense to be able to log this sort of info.
 

TheMadDBA

Active Member
It has been about 100 years since I have done this... but I believe it should still work.

Make a new startup procedure that contains the following code:

Code:
ON CREATE OF <yourtable> DO:
  MESSAGE 
PROGRAM-NAME(1) PROGRAM-NAME(2) PROGRAM-NAME(3) PROGRAM-NAME(4)
PROGRAM-NAME(5) PROGRAM-NAME(6) PROGRAM-NAME(7) PROGRAM-NAME(8)
PROGRAM-NAME(9) VIEW-AS ALERT-BOX INFO.
END.

RUN <yournormalstartup.p>.
 
  • Like
Reactions: rzr

TomBascom

Curmudgeon
In case it isn't obvious... TheMadDBA is suggesting that you create a SESSION trigger -- this trigger only applies to the session that uses the special startup procedure. Basically you are creating a wrapper around your normal session. This allows you to debug this sort of thing without having to create a permanent database trigger and without impacting anyone else's session.

It can be a very handy technique.
 

altair

Member
Hi,

Thanks a lot !
The Session Trigger (ON CREATE OF...) is doing what I need.

I will also see if I can submit an enhancement request to Progress about the automatic log of DB record in -clientlog.
Could you please indicates me the procedure to follow for this ?

Thanks in advance !
 
Top