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.

Trigger How to!

4 posts in General Discussion Last posting was on 2003-07-15 11:30:39.0Z
Matani Posted on 2003-07-10 12:14:32.0Z
Reply-To: "Matani" <S.Matani@ads-tec.de>
From: "Matani" <saleh@matani.net>
Subject: Trigger How to!
Date: Thu, 10 Jul 2003 14:14:32 +0200
Lines: 19
Organization: sudent
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <emdtn3tRDHA.314@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: gabriel.le1.ads-tec.de 62.153.239.43
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1307
Article PK: 3542

i need to create a Trigger to watch in Table names "Cust" , when update or
insert
, copy the updated or inserted recordset to History Table names "Cust_his"

ALTER TRIGGER insertupdate AFTER INSERT, UPDATE
ORDER 1 ON "DBA"."cust"
FOR EACH ROW

BEGIN
????

END

thank you

Matani


Robert Waywell Posted on 2003-07-10 13:28:58.0Z
From: "Robert Waywell" <nospam_rwaywell@ianywhere.com>
References: <emdtn3tRDHA.314@forums-2-dub>
Subject: Re: Trigger How to!
Date: Thu, 10 Jul 2003 09:28:58 -0400
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <OCwXehuRDHA.298@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: rwaywell-pc.sybase.com 172.31.143.74
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1310
Article PK: 3544

You already have the outline, now you just need to do the INSERT. The new
values are available as NEW.<column_name> for all columns that are
referenced in the INSERT or UPDATE statement that is firing the trigger.

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://casexpress.sybase.com/cx/cx.stm

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

"Matani" <saleh@matani.net> wrote in message
news:emdtn3tRDHA.314@forums-2-dub...
> i need to create a Trigger to watch in Table names "Cust" , when update or
> insert
> , copy the updated or inserted recordset to History Table names "Cust_his"
>
> ALTER TRIGGER insertupdate AFTER INSERT, UPDATE
> ORDER 1 ON "DBA"."cust"
> FOR EACH ROW
>
> BEGIN
> ????
>
> END
>
> thank you
>
> Matani
>
>
>


florence Posted on 2003-07-15 09:31:46.0Z
From: florence
Date: Tue, 15 Jul 2003 05:31:46 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Trigger How to!
Message-ID: <C689A04E7779CA4C0034589985256D64.0050B38785256D5F@webforums>
References: <emdtn3tRDHA.314@forums-2-dub> <OCwXehuRDHA.298@forums-2-dub>
Lines: 6
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1329
Article PK: 3565

If I need to create a trigger similar as Matani's case but it insert/update
to a remote database. How can I do that?

Thanks in advance!

Florence


Breck Carter [TeamSybase] Posted on 2003-07-15 11:30:39.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com>
Subject: Re: Trigger How to!
Date: Tue, 15 Jul 2003 07:30:39 -0400
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <pcp7hvkk2al9nbqpg925fggskhb9q7d1pq@4ax.com>
References: <emdtn3tRDHA.314@forums-2-dub> <OCwXehuRDHA.298@forums-2-dub> <C689A04E7779CA4C0034589985256D64.0050B38785256D5F@webforums>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: bcarter.sentex.ca 64.7.134.118
Lines: 11
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1330
Article PK: 3562

Use a proxy table.

Adaptive Server Anywhere SQL User's Guide
15. Accessing Remote Data

Breck

"On Tue, 15 Jul 2003 05:31:46 -0400, florence wrote:

>If I need to create a trigger similar as Matani's case but it insert/update
>to a remote database. How can I do that?
>
>Thanks in advance!
>
>Florence

bcarter@risingroad.com
Mobile and Distributed Enterprise Database Applications
http://www.risingroad.com