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

2 posts in General Discussion Last posting was on 2006-07-18 15:39:27.0Z
Juan Herrera Posted on 2006-07-18 15:10:56.0Z
Sender: 2e62.44bcf907.1804289383@sybase.com
From: Juan Herrera
Newsgroups: ianywhere.public.general
Subject: Triggers
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <44bcfa00.2e70.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 18 Jul 2006 08:10:56 -0700
X-Trace: forums-1-dub 1153235456 10.22.241.41 (18 Jul 2006 08:10:56 -0700)
X-Original-Trace: 18 Jul 2006 08:10:56 -0700, 10.22.241.41
Lines: 8
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5515
Article PK: 1554

Hi...

Is possible indentify if a trigger is fired by insert,
delete or update? into the definition?

Thanks!!

Juan Herrera


Breck Carter [Team iAnywhere] Posted on 2006-07-18 15:39:27.0Z
From: "Breck Carter [Team iAnywhere]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: Triggers
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <vnvpb2d6n1al4ggnokthc2app3v95orptu@4ax.com>
References: <44bcfa00.2e70.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: bcarter.sentex.ca
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
Date: 18 Jul 2006 08:39:27 -0700
X-Trace: forums-1-dub 1153237167 64.7.134.118 (18 Jul 2006 08:39:27 -0700)
X-Original-Trace: 18 Jul 2006 08:39:27 -0700, bcarter.sentex.ca
Lines: 32
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5516
Article PK: 1555

You need a copy of my book <g>...

CREATE TRIGGER triud_t1
BEFORE INSERT, DELETE, UPDATE
ON t1
FOR EACH ROW
BEGIN
CASE
WHEN INSERTING THEN MESSAGE 'Inserting t1.' TO CONSOLE;
WHEN UPDATING THEN MESSAGE 'Updating t1.' TO CONSOLE;
WHEN DELETING THEN MESSAGE 'Deleting t1.' TO CONSOLE;
END CASE;
END;

On 18 Jul 2006 08:10:56 -0700, Juan Herrera wrote:

>Hi...
>
>Is possible indentify if a trigger is fired by insert,
>delete or update? into the definition?
>
>Thanks!!
>
>Juan Herrera

--
Breck Carter [Team iAnywhere]
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
The book: http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
breck.carter@risingroad.com