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

3 posts in NT Last posting was on 2011-08-02 02:42:54.0Z
Kim Jensen Posted on 2011-07-21 23:18:12.0Z
Reply-To: "Kim Jensen" <kim@comcasystems.com>
From: "Kim Jensen" <kim@comcasystems.com>
Newsgroups: Advantage.NT
Subject: Triggers
Date: Thu, 21 Jul 2011 19:18:12 -0400
Lines: 19
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6002.18197
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18463
NNTP-Posting-Host: 173.65.153.232
Message-ID: <4e28b3d5$1@solutions.advantagedatabase.com>
X-Trace: 21 Jul 2011 16:18:45 -0700, 173.65.153.232
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.NT:1837
Article PK: 1130946

Adv NT 9.1 using DD

I made a trigger with the Trigger Type AFTER and the event type to UPDATE.
What I want is a timestamp everytime that record gets updated.
My problem; after I added the trigger only the Timestamp field get update
all other fields stay the same as before the record update.

Here is my trigger:

DECLARE @ LabelNumber char(11);
@LabelNumber = (SELECT [GarmNumLong] from __old);
UPDATE GarmLabel
SET DateUpd = now()
Where
GarmnumLong = @LabelNumber;

Thanks,
Kim


Edgar Sherman Posted on 2011-07-22 16:51:06.0Z
Date: Fri, 22 Jul 2011 10:51:06 -0600
From: Edgar Sherman <no@email.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
MIME-Version: 1.0
Newsgroups: Advantage.NT
Subject: Re: Triggers
References: <4e28b3d5$1@solutions.advantagedatabase.com>
In-Reply-To: <4e28b3d5$1@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 10.6.193.121
Message-ID: <4e29aa72@solutions.advantagedatabase.com>
X-Trace: 22 Jul 2011 09:50:58 -0700, 10.6.193.121
Lines: 29
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.NT:1838
Article PK: 1130951

This should work. Are you not getting any errors? Are you sure this
was not an "INSTEAD OF" trigger?

Instead of using triggers, it may be more efficient to use a modtime
field type for the timestamp.

Edgar

On 7/21/2011 5:18 PM, Kim Jensen wrote:
> Adv NT 9.1 using DD
>
> I made a trigger with the Trigger Type AFTER and the event type to UPDATE.
> What I want is a timestamp everytime that record gets updated.
> My problem; after I added the trigger only the Timestamp field get
> update all other fields stay the same as before the record update.
>
> Here is my trigger:
>
> DECLARE @ LabelNumber char(11);
> @LabelNumber = (SELECT [GarmNumLong] from __old);
> UPDATE GarmLabel
> SET DateUpd = now()
> Where
> GarmnumLong = @LabelNumber;
>
> Thanks,
> Kim


Kim Jensen Posted on 2011-08-02 02:42:54.0Z
From: "Kim Jensen" <kim@comcasystems.com>
Newsgroups: Advantage.NT
References: <4e28b3d5$1@solutions.advantagedatabase.com> <4e29aa72@solutions.advantagedatabase.com>
In-Reply-To: <4e29aa72@solutions.advantagedatabase.com>
Subject: Re: Triggers
Date: Mon, 1 Aug 2011 22:42:54 -0400
Lines: 1
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 15.4.3508.1109
X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3508.1109
NNTP-Posting-Host: 96.254.233.196
Message-ID: <4e376408$1@solutions.advantagedatabase.com>
X-Trace: 1 Aug 2011 19:42:16 -0700, 96.254.233.196
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.NT:1839
Article PK: 1130948

The only different between me and my customer is, that I have ADS 8.1 and he
have ADS 9.1.
I made a program In Delphi on the 8.1 computer that would take free tables
and and the information into a ADS DD.

Just like this:
Open;
Label1.Caption := 'Open';
DDadt.FieldByName('Number').AsString :=
FreeAdt.FieldByName('Number').AsString;
etc..

Then I download my customers database to my computer and run the same
program and same trigger and it worked.

For some reason it did not work on his computer, I get no errors and no
errors in the ADS_ERR.adt
I added labels on the form and each record went thru, but the data did not
get updated.

The reason I made a trigger with timestamp, was that my customer say that
the data after it get updated in the morning it goes back to the old data it
had the day before. I wanted to see if at anytime doing the day that the
data got updated.

I added a log file where all updates get saved, that works fine.

Thanks,
Kim


"Edgar Sherman" wrote in message
news:4e29aa72@solutions.advantagedatabase.com...


This should work. Are you not getting any errors? Are you sure this
was not an "INSTEAD OF" trigger?

Instead of using triggers, it may be more efficient to use a modtime
field type for the timestamp.

Edgar

On 7/21/2011 5:18 PM, Kim Jensen wrote:
> Adv NT 9.1 using DD
>
> I made a trigger with the Trigger Type AFTER and the event type to UPDATE.
> What I want is a timestamp everytime that record gets updated.
> My problem; after I added the trigger only the Timestamp field get
> update all other fields stay the same as before the record update.
>
> Here is my trigger:
>
> DECLARE @ LabelNumber char(11);
> @LabelNumber = (SELECT [GarmNumLong] from __old);
> UPDATE GarmLabel
> SET DateUpd = now()
> Where
> GarmnumLong = @LabelNumber;
>
> Thanks,
> Kim