Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Trigger for logging changes in a database

5 posts in Trigger Last posting was on 2011-09-08 06:43:32.0Z
G?nter Kieninger Posted on 2011-09-05 15:43:27.0Z
Date: Mon, 05 Sep 2011 17:43:27 +0200
Newsgroups: Advantage.Trigger
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: Virtual Access Open Source http://www.virtual-access.org/
Organization: My Company
Message-ID: <VA.0000007b.007db1f2@mgm.at>
Subject: Trigger for logging changes in a database
From: G?nter Kieninger <g.kieninger@mgm.at>
NNTP-Posting-Host: 62.99.177.217
X-Trace: 5 Sep 2011 08:43:34 -0700, 62.99.177.217
Lines: 20
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.Trigger:498
Article PK: 1136558

Hi!

Does anybody have a small example on how I can change changes in a
database in a LogFile. The Changes should end up in one record with the
following fields:

tdh_user -> Username -> No Problem
tdh_date -> Date/Time -> No Problem
tdh_changed -> Memo -> filled like this


[FieldName] Oldvalue -> NewValue #13#10
[fieldname] Oldvalue -> NewValue #13#10

How can this be done without writing a trigger for every table?

Thank you
g?nter


Thomas Steinmaurer Posted on 2011-09-05 15:51:49.0Z
Date: Mon, 05 Sep 2011 17:51:49 +0200
From: Thomas Steinmaurer <t.steinmaurer_dontbugmewithspam_@upscene.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.21) Gecko/20110830 Thunderbird/3.1.13
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Trigger for logging changes in a database
References: <VA.0000007b.007db1f2@mgm.at>
In-Reply-To: <VA.0000007b.007db1f2@mgm.at>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.10.197.199
Message-ID: <4e64effc$1@solutions.advantagedatabase.com>
X-Trace: 5 Sep 2011 08:51:24 -0700, 81.10.197.199
Lines: 21
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.Trigger:499
Article PK: 1136559


> Does anybody have a small example on how I can change changes in a
> database in a LogFile. The Changes should end up in one record with the
> following fields:
>
> tdh_user -> Username -> No Problem
> tdh_date -> Date/Time -> No Problem
> tdh_changed -> Memo -> filled like this
>
>
> [FieldName] Oldvalue -> NewValue #13#10
> [fieldname] Oldvalue -> NewValue #13#10
>
> How can this be done without writing a trigger for every table?

You need a trigger on each table you want to log.

Before re-inventing the wheel, you could look at ADS LogManager:
http://www.upscene.com/products.audit.adslm_main.php

Regards,
Thomas


Thomas Steinmaurer Posted on 2011-09-07 14:00:37.0Z
Date: Wed, 07 Sep 2011 16:00:37 +0200
From: Thomas Steinmaurer <t.steinmaurer_dontbugmewithspam@upscene.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.21) Gecko/20110830 Thunderbird/3.1.13
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Trigger for logging changes in a database
References: <VA.0000007b.007db1f2@mgm.at> <4e64effc$1@solutions.advantagedatabase.com>
In-Reply-To: <4e64effc$1@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.186.164.88
Message-ID: <4e6778e6$1@solutions.advantagedatabase.com>
X-Trace: 7 Sep 2011 07:00:06 -0700, 193.186.164.88
Lines: 26
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.Trigger:500
Article PK: 1136561


>> Does anybody have a small example on how I can change changes in a
>> database in a LogFile. The Changes should end up in one record with the
>> following fields:
>>
>> tdh_user -> Username -> No Problem
>> tdh_date -> Date/Time -> No Problem
>> tdh_changed -> Memo -> filled like this
>>
>>
>> [FieldName] Oldvalue -> NewValue #13#10
>> [fieldname] Oldvalue -> NewValue #13#10
>>
>> How can this be done without writing a trigger for every table?
>
> You need a trigger on each table you want to log.
>
> Before re-inventing the wheel, you could look at ADS LogManager:
> http://www.upscene.com/products.audit.adslm_main.php

Btw, V3 of ADS LogManager with ADS V10.10 incl. Unicode support has been
released today.



Regards,
Thomas


G?nter Kieninger Posted on 2011-09-08 06:02:47.0Z
Date: Thu, 08 Sep 2011 08:02:47 +0200
Newsgroups: Advantage.Trigger
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: Virtual Access Open Source http://www.virtual-access.org/
Organization: My Company
Message-ID: <VA.0000007d.09ebc93b@mgm.at>
Subject: Re: Trigger for logging changes in a database
From: G?nter Kieninger <g.kieninger@mgm.at>
References: <VA.0000007b.007db1f2@mgm.at> <4e64effc$1@solutions.advantagedatabase.com> <4e6778e6$1@solutions.advantagedatabase.com>
NNTP-Posting-Host: 62.99.177.217
X-Trace: 7 Sep 2011 23:02:17 -0700, 62.99.177.217
Lines: 5
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.Trigger:501
Article PK: 1136562

Hi!

Just installed it. Thank you.
G?nter


Thomas Steinmaurer Posted on 2011-09-08 06:43:32.0Z
Date: Thu, 08 Sep 2011 08:43:32 +0200
From: Thomas Steinmaurer <t.steinmaurer_dontbugmewithspam@upscene.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.22) Gecko/20110902 Thunderbird/3.1.14
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Trigger for logging changes in a database
References: <VA.0000007b.007db1f2@mgm.at> <4e64effc$1@solutions.advantagedatabase.com> <4e6778e6$1@solutions.advantagedatabase.com> <VA.0000007d.09ebc93b@mgm.at>
In-Reply-To: <VA.0000007d.09ebc93b@mgm.at>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 193.186.164.88
Message-ID: <4e6863f3$1@solutions.advantagedatabase.com>
X-Trace: 7 Sep 2011 23:42:59 -0700, 193.186.164.88
Lines: 11
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.Trigger:502
Article PK: 1136563


> Hi!
>
> Just installed it. Thank you.

Let me know if you need any help.

Greetings from Linz/O?. ;-)


Regards,
Thomas