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.

Triggers do it better?

3 posts in Trigger Last posting was on 2003-12-13 19:14:11.0Z
Rui Rego Posted on 2003-12-12 22:33:52.0Z
From: "Rui Rego" <rego.rui@clix.pt>
Newsgroups: Advantage.Trigger
Subject: Triggers do it better?
Date: Fri, 12 Dec 2003 22:33:52 -0000
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 195.23.206.247
Message-ID: <3fda42cd@solutions.advantagedatabase.com>
X-Trace: 12 Dec 2003 15:35:57 -0700, 195.23.206.247
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!195.23.206.247
Xref: solutions.advantagedatabase.com Advantage.Trigger:15
Article PK: 1136085

Theres a problem associated with all acounting software! Keeping accumulated
values, in many relation tables, always right! Newbie in Advantage and SQL,
after reading part of Advantage book i think that triggers can do a
excellent job in this kind of trouble. Yes, i can do it with code, but
theres always something missing... specially when editing!
Lets go to a pratical example:
Customers vs. orders vs. itemtkind vs. items
Inserting and deleting are no problem, sum or subtract values from all
relation tables.
But, when i change itemkind, i've must subtract the value in itemkind total,
sum the value in the new itemkind and, if item changed, do the same in item
table.
It seems simple, but i my application, with many relations tables, when a
item in each line could be related to a specific table, isnt a easy job!
Resumming, my question is:
Its better doing this with triggers?
Forgive my bad english...
Thanks,
Rui


GNR Posted on 2003-12-13 19:14:11.0Z
Date: Sun, 14 Dec 2003 00:44:11 +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: Triggers do it better?
References: <3fda42cd@solutions.advantagedatabase.com>
In-Reply-To: <3fda42cd@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 220.226.30.76
Message-ID: <3fdb6617@solutions.advantagedatabase.com>
X-Trace: 13 Dec 2003 12:18:47 -0700, 220.226.30.76
Lines: 36
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!220.226.30.76
Xref: solutions.advantagedatabase.com Advantage.Trigger:17
Article PK: 1136086

triggers is the best way no doubt.

in oracle i do mostly with triggers.

in xbase, i keep one library to do all the writes. the lib functions do
what essentically the triggers do. now that ADS provides for triggers, I
am trying to convert my code into triggers.

GNR

Rui Rego wrote:
> Theres a problem associated with all acounting software! Keeping accumulated
> values, in many relation tables, always right! Newbie in Advantage and SQL,
> after reading part of Advantage book i think that triggers can do a
> excellent job in this kind of trouble. Yes, i can do it with code, but
> theres always something missing... specially when editing!
> Lets go to a pratical example:
> Customers vs. orders vs. itemtkind vs. items
> Inserting and deleting are no problem, sum or subtract values from all
> relation tables.
> But, when i change itemkind, i've must subtract the value in itemkind total,
> sum the value in the new itemkind and, if item changed, do the same in item
> table.
> It seems simple, but i my application, with many relations tables, when a
> item in each line could be related to a specific table, isnt a easy job!
> Resumming, my question is:
> Its better doing this with triggers?
> Forgive my bad english...
> Thanks,
> Rui
>
>
>
>


Tom Olson Posted on 2003-12-13 08:42:08.0Z
From: "Tom Olson" <tolson@advancegroup.com>
Newsgroups: Advantage.Trigger
References: <3fda42cd@solutions.advantagedatabase.com>
Subject: Re: Triggers do it better?
Date: Sat, 13 Dec 2003 02:42:08 -0600
Lines: 28
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: 209.240.76.14
Message-ID: <3fdad220@solutions.advantagedatabase.com>
X-Trace: 13 Dec 2003 01:47:28 -0700, 209.240.76.14
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!209.240.76.14
Xref: solutions.advantagedatabase.com Advantage.Trigger:16
Article PK: 1136087

Rui,

I'm not sure I understand you correctly. Do your order and order detail tables
store the values at the time of the sale or are you referencing them back to you
items (products?) table?

Tom

"Rui Rego" wrote:
> Theres a problem associated with all acounting software! Keeping accumulated
> values, in many relation tables, always right! Newbie in Advantage and SQL,
> after reading part of Advantage book i think that triggers can do a
> excellent job in this kind of trouble. Yes, i can do it with code, but
> theres always something missing... specially when editing!
> Lets go to a pratical example:
> Customers vs. orders vs. itemtkind vs. items
> Inserting and deleting are no problem, sum or subtract values from all
> relation tables.
> But, when i change itemkind, i've must subtract the value in itemkind total,
> sum the value in the new itemkind and, if item changed, do the same in item
> table.
> It seems simple, but i my application, with many relations tables, when a
> item in each line could be related to a specific table, isnt a easy job!
> Resumming, my question is:
> Its better doing this with triggers?
> ...