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.

access record before and after edit

7 posts in Trigger Last posting was on 2009-03-12 17:06:51.0Z
Isaac Welliam Posted on 2009-03-09 02:13:47.0Z
Date: Mon, 09 Mar 2009 04:13:47 +0200
From: Isaac Welliam <no@no.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: advantage.trigger
Subject: access record before and after edit
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 41.234.199.190
Message-ID: <49b47abe@solutions.advantagedatabase.com>
X-Trace: 8 Mar 2009 19:11:10 -0700, 41.234.199.190
Lines: 5
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!41.234.199.190
Xref: solutions.advantagedatabase.com Advantage.Trigger:425
Article PK: 1136485

Hello,
I am new to advantage db , and I wonder how to access record value
before and after modifications from database trigger or from Delphi code ?

Thanks


Joachim Duerr (ADS) Posted on 2009-03-09 10:33:07.0Z
From: "Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Subject: Re: access record before and after edit
Newsgroups: Advantage.Trigger
References: <49b47abe@solutions.advantagedatabase.com>
Date: Mon, 9 Mar 2009 11:33:07 +0100
User-Agent: XanaNews/1.19.1.110
X-Face: u2p+</,mb|Ah!x!/qxX5q0t:O~.<1&JzwNHYhSqcviY{~&|iDc"U.Je1A.ZeHR`d;;y#R
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 10.56.66.108
Message-ID: <49b4f047@solutions.advantagedatabase.com>
X-Trace: 9 Mar 2009 03:32:39 -0700, 10.56.66.108
Lines: 21
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.56.66.108
Xref: solutions.advantagedatabase.com Advantage.Trigger:426
Article PK: 1136486


Isaac Welliam wrote:

>I am new to advantage db , and I wonder how to access record value
>before and after modifications from database trigger or from Delphi
>code ?

sorry, i don't really understand your needs.

Inside the trigger you'll have two tables:

__old contains the old record on update and delete
__new contains the new record on insert and update

In Delphi, just refresh the AdsTable to get the values modified inside
the trigger.

--
Joachim Duerr
Advantage Presales
Sybase GmbH
please don't reply via email


Isaac Welliam Posted on 2009-03-09 21:33:18.0Z
Date: Mon, 09 Mar 2009 23:33:18 +0200
From: Isaac Welliam <no@no.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: access record before and after edit
References: <49b47abe@solutions.advantagedatabase.com> <49b4f047@solutions.advantagedatabase.com>
In-Reply-To: <49b4f047@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 41.234.199.5
Message-ID: <49b58a82@solutions.advantagedatabase.com>
X-Trace: 9 Mar 2009 14:30:42 -0700, 41.234.199.5
Lines: 6
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!41.234.199.5
Xref: solutions.advantagedatabase.com Advantage.Trigger:427
Article PK: 1136488

thanks what you said is what I need I much appreciate your help,
please guide me to a help file or a reference to how I can make trigger
in advantage db.

Thanks alot


Joachim Duerr (ADS) Posted on 2009-03-10 08:47:11.0Z
From: "Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Subject: Re: access record before and after edit
Newsgroups: Advantage.Trigger
References: <49b47abe@solutions.advantagedatabase.com> <49b4f047@solutions.advantagedatabase.com> <49b58a82@solutions.advantagedatabase.com>
Date: Tue, 10 Mar 2009 09:47:11 +0100
User-Agent: XanaNews/1.19.1.110
X-Face: u2p+</,mb|Ah!x!/qxX5q0t:O~.<1&JzwNHYhSqcviY{~&|iDc"U.Je1A.ZeHR`d;;y#R
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 10.56.66.108
Message-ID: <49b628f2@solutions.advantagedatabase.com>
X-Trace: 10 Mar 2009 01:46:42 -0700, 10.56.66.108
Lines: 13
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.56.66.108
Xref: solutions.advantagedatabase.com Advantage.Trigger:428
Article PK: 1136489


Isaac Welliam wrote:

>thanks what you said is what I need I much appreciate your help,
>please guide me to a help file or a reference to how I can make
>trigger in advantage db.

http://devzone.advantagedatabase.com/dz/webhelp/Advantage9.1/advantage_concepts/advantage_functionality/triggers.htm

--
Joachim Duerr
Advantage Presales
Sybase GmbH
please don't reply via email


Isaac Welliam Posted on 2009-03-11 02:55:43.0Z
Date: Wed, 11 Mar 2009 04:55:43 +0200
From: Isaac Welliam <no@no.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: access record before and after edit
References: <49b47abe@solutions.advantagedatabase.com> <49b4f047@solutions.advantagedatabase.com> <49b58a82@solutions.advantagedatabase.com> <49b628f2@solutions.advantagedatabase.com>
In-Reply-To: <49b628f2@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 41.234.200.100
Message-ID: <49b72794@solutions.advantagedatabase.com>
X-Trace: 10 Mar 2009 19:53:08 -0700, 41.234.200.100
Lines: 2
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!41.234.200.100
Xref: solutions.advantagedatabase.com Advantage.Trigger:429
Article PK: 1136490

thanks


Isaac Welliam Posted on 2009-03-12 15:41:40.0Z
Date: Thu, 12 Mar 2009 17:41:40 +0200
From: Isaac Welliam <no@no.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: access record before and after edit
References: <49b47abe@solutions.advantagedatabase.com> <49b4f047@solutions.advantagedatabase.com> <49b58a82@solutions.advantagedatabase.com> <49b628f2@solutions.advantagedatabase.com>
In-Reply-To: <49b628f2@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 41.236.171.174
Message-ID: <49b92c9c@solutions.advantagedatabase.com>
X-Trace: 12 Mar 2009 08:39:08 -0700, 41.236.171.174
Lines: 2
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!41.236.171.174
Xref: solutions.advantagedatabase.com Advantage.Trigger:430
Article PK: 1136491

can you guide me to an sql script example of accessing old and new
values in triggers , I cant find any


Thomas Steinmaurer Posted on 2009-03-12 17:06:51.0Z
Date: Thu, 12 Mar 2009 18:06:51 +0100
From: Thomas Steinmaurer <t.steinmaurer_dontbugmewithspam_@upscene.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: access record before and after edit
References: <49b47abe@solutions.advantagedatabase.com> <49b4f047@solutions.advantagedatabase.com> <49b58a82@solutions.advantagedatabase.com> <49b628f2@solutions.advantagedatabase.com> <49b92c9c@solutions.advantagedatabase.com>
In-Reply-To: <49b92c9c@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 212.241.89.51
Message-ID: <49b9410a@solutions.advantagedatabase.com>
X-Trace: 12 Mar 2009 10:06:18 -0700, 212.241.89.51
Lines: 21
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!212.241.89.51
Xref: solutions.advantagedatabase.com Advantage.Trigger:431
Article PK: 1136492


> can you guide me to an sql script example of accessing old and new
> values in triggers , I cant find any

This is done via the __old and __new table available in the trigger.

http://devzone.advantagedatabase.com/dz/webhelp/Advantage9.1/trigger___old___new_and___error_tables.htm


Just query them like any other table.

--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com
My blog:
http://blog.upscene.com/thomas/