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.

After triggers and rowversion

3 posts in Trigger Last posting was on 2006-11-10 17:39:05.0Z
Paul Man Posted on 2006-11-09 17:18:08.0Z
From: "Paul Man" <paulman@datasoft.ie>
Newsgroups: advantage.trigger
Subject: After triggers and rowversion
Date: Thu, 9 Nov 2006 17:18:08 -0000
Lines: 10
Organization: DSoft
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 82.141.233.142
Message-ID: <455361fa@solutions.advantagedatabase.com>
X-Trace: 9 Nov 2006 10:14:34 -0700, 82.141.233.142
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!82.141.233.142
Xref: solutions.advantagedatabase.com Advantage.Trigger:287
Article PK: 1136354

If I have an after update trigger that update the fields of the __new
records, do they subsequently increment the rowversion also?

i.e. I update a record and then the after update trigger subsequently
updates the same record, should this update the rowversion also?

On a secondary note ... Can I have the same trigger apply to both insert and
updates?


Peter Funk (ADS) Posted on 2006-11-09 21:56:55.0Z
Date: Thu, 9 Nov 2006 21:56:55 +0000 (UTC)
Message-ID: <864d0bcb37e08c8d2266f1524f0@devzone.advantagedatabase.com>
From: Peter Funk (ADS) <pfunk@nospam.com>
Subject: Re: After triggers and rowversion
Newsgroups: Advantage.Trigger
References: <455361fa@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Reader 936.5
NNTP-Posting-Host: 10.24.38.115
X-Trace: 9 Nov 2006 14:52:41 -0700, 10.24.38.115
Lines: 26
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.115
Xref: solutions.advantagedatabase.com Advantage.Trigger:289
Article PK: 1136356


> If I have an after update trigger that update the fields of the __new
> records, do they subsequently increment the rowversion also?

No, updates to the __new record do not increment the rowversion value in
the __new record.

> i.e. I update a record and then the after update trigger subsequently
> updates the same record, should this update the rowversion also?

If the after update trigger updates the same row in the base table as the
original update, then yes, the original record gets a new rowversion value.
So the result would be that two rowversion values were used during the update
because the base table record was updated twice.

> On a secondary note ... Can I have the same trigger apply to both
> insert and updates?

No. You need to create separate triggers for each event type. Each trigger
could point to the same DLL, .net assembly, etc, but each trigger still needs
a unique object in the data dictionary.

Regards,
Peter Funk
Advantage R&D


Paul Man Posted on 2006-11-10 17:39:05.0Z
From: "Paul Man" <paulman@datasoft.ie>
Newsgroups: Advantage.Trigger
References: <455361fa@solutions.advantagedatabase.com> <864d0bcb37e08c8d2266f1524f0@devzone.advantagedatabase.com>
Subject: Re: After triggers and rowversion
Date: Fri, 10 Nov 2006 17:39:05 -0000
Lines: 32
Organization: DSoft
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 82.141.233.142
Message-ID: <4554b862@solutions.advantagedatabase.com>
X-Trace: 10 Nov 2006 10:35:30 -0700, 82.141.233.142
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!82.141.233.142
Xref: solutions.advantagedatabase.com Advantage.Trigger:290
Article PK: 1136355

Thanks.

"Peter Funk (ADS)" <pfunk@nospam.com> wrote in message
news:864d0bcb37e08c8d2266f1524f0@devzone.advantagedatabase.com...
>> If I have an after update trigger that update the fields of the __new
>> records, do they subsequently increment the rowversion also?
>
> No, updates to the __new record do not increment the rowversion value in
> the __new record.
>
>> i.e. I update a record and then the after update trigger subsequently
>> updates the same record, should this update the rowversion also?
>
> If the after update trigger updates the same row in the base table as the
> original update, then yes, the original record gets a new rowversion
> value. So the result would be that two rowversion values were used during
> the update because the base table record was updated twice.
>
>> On a secondary note ... Can I have the same trigger apply to both
>> insert and updates?
>
> No. You need to create separate triggers for each event type. Each
> trigger could point to the same DLL, .net assembly, etc, but each trigger
> still needs a unique object in the data dictionary.
>
> Regards,
> Peter Funk
> Advantage R&D
>
>