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.

Automatic Trigger Adding?

5 posts in Trigger Last posting was on 2004-02-06 17:11:43.0Z
"Gabri?l vd Kruijk" <gabriel[asdfasdf]{asdfasdf) Posted on 2004-01-17 16:40:48.0Z
From: "Gabri?l vd Kruijk" <gabriel[asdfasdf]{asdfasdf)@spammers.zijn.dwazen(marti.nl)>
Newsgroups: Advantage.Trigger
Subject: Automatic Trigger Adding?
Date: Sat, 17 Jan 2004 17:40:48 +0100
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 62.45.153.247
Message-ID: <4010fc2a@solutions.advantagedatabase.com>
X-Trace: 23 Jan 2004 03:49:14 -0700, 62.45.153.247
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!62.45.153.247
Xref: solutions.advantagedatabase.com Advantage.Trigger:20
Article PK: 1136090

Hi,

Since I woulde like to be able to capture every event that happens on my
ADD, I was wondering what's the best approach?

I could create INSERT / UPDATE AND DELETE, before, instead off and after
events for each and every table, or is there a better way?

Or should I put this al in to my code, instead of using triggers? (Maybe I'm
missing the purpose / best practice) of using triggers)

Anyone any suggestions?

Greets,
Gab


Brad Schmidt Posted on 2004-01-26 19:55:29.0Z
From: Brad Schmidt <brad.schmidt.nospam@extendedsystems.com>
Newsgroups: Advantage.Trigger
Subject: Re: Automatic Trigger Adding?
Date: Mon, 26 Jan 2004 12:55:29 -0700
Message-ID: <MPG.1a7f1e996ed6fe069896cb@solutions.AdvantageDatabase.com>
References: <4010fc2a@solutions.advantagedatabase.com>
Organization: ESI
X-Newsreader: MicroPlanet Gravity v2.50
NNTP-Posting-Host: 198.102.102.29
X-Trace: 26 Jan 2004 13:00:01 -0700, 198.102.102.29
Lines: 35
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!198.102.102.29
Xref: solutions.advantagedatabase.com Advantage.Trigger:24
Article PK: 1136093

Gab,

IMO, triggers are by far a better way of doing this than putting it in
your code for two main reasons:
1) you don't need to duplicate that code in every application you have
(and thus have to update it in multiple places should you want to change
something)
2) The trigger will fire regardless what app uses the data. So somebody
can open your tables with the Data Architect and your triggers will
fire. If you have the logic in code in your apps, changes made via ARC
(or any other app) won't be captured.

In article <4010fc2a@solutions.advantagedatabase.com>, "Gabri?l vd
Kruijk" <gabriel[asdfasdf]{asdfasdf)@spammers.zijn.dwazen(marti.nl)>
says...

> Hi,
>
> Since I woulde like to be able to capture every event that happens on my
> ADD, I was wondering what's the best approach?
>
> I could create INSERT / UPDATE AND DELETE, before, instead off and after
> events for each and every table, or is there a better way?
>
> Or should I put this al in to my code, instead of using triggers? (Maybe I'm
> missing the purpose / best practice) of using triggers)
>
> Anyone any suggestions?
>
> Greets,
> Gab

Brad
--
* Brad Schmidt
* Extended Systems, Inc


GNR Posted on 2004-02-05 17:29:04.0Z
Date: Thu, 05 Feb 2004 22:59:04 +0530
From: GNR <gnr@hyderabadwater.gov.in>
Reply-To: gnr@hyderabadwater.gov.in
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Automatic Trigger Adding?
References: <4010fc2a@solutions.advantagedatabase.com> <MPG.1a7f1e996ed6fe069896cb@solutions.AdvantageDatabase.com>
In-Reply-To: <MPG.1a7f1e996ed6fe069896cb@solutions.AdvantageDatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 220.226.40.151
Message-ID: <40227ea5@solutions.advantagedatabase.com>
X-Trace: 5 Feb 2004 10:34:29 -0700, 220.226.40.151
Lines: 47
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!220.226.40.151
Xref: solutions.advantagedatabase.com Advantage.Trigger:26
Article PK: 1136096

I have this doubt. I understand triggers work only with dictionaries. If
so, if an application opens the table as a free table, not by opening
the dictionary, will tirggers still work? May not. If so, how can we
be sure that modifications by any other application will fire the trigger?

GNR

Brad Schmidt wrote:
> Gab,
>
> IMO, triggers are by far a better way of doing this than putting it in
> your code for two main reasons:
> 1) you don't need to duplicate that code in every application you have
> (and thus have to update it in multiple places should you want to change
> something)
> 2) The trigger will fire regardless what app uses the data. So somebody
> can open your tables with the Data Architect and your triggers will
> fire. If you have the logic in code in your apps, changes made via ARC
> (or any other app) won't be captured.
>
> In article <4010fc2a@solutions.advantagedatabase.com>, "Gabri?l vd
> Kruijk" <gabriel[asdfasdf]{asdfasdf)@spammers.zijn.dwazen(marti.nl)>
> says...
>
>>Hi,
>>
>>Since I woulde like to be able to capture every event that happens on my
>>ADD, I was wondering what's the best approach?
>>
>>I could create INSERT / UPDATE AND DELETE, before, instead off and after
>>events for each and every table, or is there a better way?
>>
>>Or should I put this al in to my code, instead of using triggers? (Maybe I'm
>>missing the purpose / best practice) of using triggers)
>>
>>Anyone any suggestions?
>>
>>Greets,
>>Gab
>
>
> Brad
> --
> * Brad Schmidt
> * Extended Systems, Inc


Brad Schmidt Posted on 2004-02-05 19:34:33.0Z
From: Brad Schmidt <brad.schmidt.nospam@extendedsystems.com>
Newsgroups: Advantage.Trigger
Subject: Re: Automatic Trigger Adding?
Date: Thu, 5 Feb 2004 12:34:33 -0700
Message-ID: <MPG.1a8c48b2bd69d6909896db@solutions.AdvantageDatabase.com>
References: <4010fc2a@solutions.advantagedatabase.com> <MPG.1a7f1e996ed6fe069896cb@solutions.AdvantageDatabase.com> <40227ea5@solutions.advantagedatabase.com>
Organization: ESI
X-Newsreader: MicroPlanet Gravity v2.50
NNTP-Posting-Host: 198.102.102.58
X-Trace: 5 Feb 2004 12:39:27 -0700, 198.102.102.58
Lines: 61
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!198.102.102.58
Xref: solutions.advantagedatabase.com Advantage.Trigger:28
Article PK: 1136097

ADT tables that are bound to a data dictionary (aka database tables)
cannot be opened as a free table. Thus, they can't be updated without
the trigger firing. DBFs are a free-for-all. Any DBF-compatible app
can open any DBF and do whatever you want. If you really want to lock
down who is updating what data, you won't want to use DBFs. DBFs are
only useful if you still want to be able to access those tables with
legacy, non-Advantage applicatons.

In article <40227ea5@solutions.advantagedatabase.com>,
gnr@hyderabadwater.gov.in says...

> I have this doubt. I understand triggers work only with dictionaries. If
> so, if an application opens the table as a free table, not by opening
> the dictionary, will tirggers still work? May not. If so, how can we
> be sure that modifications by any other application will fire the trigger?
>
> GNR
>
>
> Brad Schmidt wrote:
> > Gab,
> >
> > IMO, triggers are by far a better way of doing this than putting it in
> > your code for two main reasons:
> > 1) you don't need to duplicate that code in every application you have
> > (and thus have to update it in multiple places should you want to change
> > something)
> > 2) The trigger will fire regardless what app uses the data. So somebody
> > can open your tables with the Data Architect and your triggers will
> > fire. If you have the logic in code in your apps, changes made via ARC
> > (or any other app) won't be captured.
> >
> > In article <4010fc2a@solutions.advantagedatabase.com>, "Gabri?l vd
> > Kruijk" <gabriel[asdfasdf]{asdfasdf)@spammers.zijn.dwazen(marti.nl)>
> > says...
> >
> >>Hi,
> >>
> >>Since I woulde like to be able to capture every event that happens on my
> >>ADD, I was wondering what's the best approach?
> >>
> >>I could create INSERT / UPDATE AND DELETE, before, instead off and after
> >>events for each and every table, or is there a better way?
> >>
> >>Or should I put this al in to my code, instead of using triggers? (Maybe I'm
> >>missing the purpose / best practice) of using triggers)
> >>
> >>Anyone any suggestions?
> >>
> >>Greets,
> >>Gab
> >
> >
> > Brad
> > --
> > * Brad Schmidt
> > * Extended Systems, Inc

Brad
--
* Brad Schmidt
* Extended Systems, Inc


GNR Posted on 2004-02-06 17:11:43.0Z
Date: Fri, 06 Feb 2004 22:41:43 +0530
From: GNR <gnr@hyderabadwater.gov.in>
Reply-To: gnr@hyderabadwater.gov.in
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Automatic Trigger Adding?
References: <4010fc2a@solutions.advantagedatabase.com> <MPG.1a7f1e996ed6fe069896cb@solutions.AdvantageDatabase.com> <40227ea5@solutions.advantagedatabase.com> <MPG.1a8c48b2bd69d6909896db@solutions.AdvantageDatabase.com>
In-Reply-To: <MPG.1a8c48b2bd69d6909896db@solutions.AdvantageDatabase.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 61.1.177.63
Message-ID: <4023cbfe@solutions.advantagedatabase.com>
X-Trace: 6 Feb 2004 10:16:46 -0700, 61.1.177.63
Lines: 3
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!61.1.177.63
Xref: solutions.advantagedatabase.com Advantage.Trigger:29
Article PK: 1136099

Thanks for the clarification. Very useful information indeed.
GNR