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 Behavior,

2 posts in Trigger Last posting was on 2007-01-02 17:43:35.0Z
Maaz Rizki Posted on 2006-12-28 14:22:30.0Z
From: "Maaz Rizki" <mrizki@fairwaymarket.com>
Newsgroups: Advantage.Trigger
Subject: Trigger Behavior,
Date: Thu, 28 Dec 2006 09:22:30 -0500
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896
NNTP-Posting-Host: 67.106.130.227
Message-ID: <4593d36e@solutions.advantagedatabase.com>
X-Trace: 28 Dec 2006 07:23:42 -0700, 67.106.130.227
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!67.106.130.227
Xref: solutions.advantagedatabase.com Advantage.Trigger:298
Article PK: 1136364

Hi Folks,

I wrote following trigger, this trigger have strange behavior, that is it
sometime works and some time it does not work. It is on Insert only. The
source file "COSTFILE" is get new records via Replication. However when I do
manual test work just fine.

Do anybody have any idea what might be going on.

----------------------------------------------------------------------------
--

CREATE TRIGGER Insert_Into_NewItems

ON COSTFILE

AFTER

INSERT

BEGIN

insert into "\\172.16.7.7\c$\DB\BackOffice\BackOffice.Add".NewItems (

Vendor_Id,Isbn,Descript,VendorItem,No_IN_Case,Cost_Each,Size,Measure,Dept,[G
roup],Order_Num,Post_Date,Post_Time)

select
a.Vendor_Id,Isbn,Descript,VendorItem,No_In_Case,Cost_Each,Size,Measure,Dept,
[Group],iif(b.AutoAssignOrder_Num=True,Trim(a.Vendor_Id)+Dept,Null)
Order_Num,Current_Date(),Current_Time() from __New a

inner join Vendor b

on a.Vendor_Id=b.Vendor_Id;

END

PRIORITY 1;

Seasons Greeting,

Regards,

Maaz Rizki


Edgar Sherman Posted on 2007-01-02 17:43:35.0Z
Date: Tue, 02 Jan 2007 10:43:35 -0700
From: Edgar Sherman <no@email.com>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Trigger Behavior,
References: <4593d36e@solutions.advantagedatabase.com>
In-Reply-To: <4593d36e@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 10.24.34.110
Message-ID: <459a98c7@solutions.advantagedatabase.com>
X-Trace: 2 Jan 2007 10:39:19 -0700, 10.24.34.110
Lines: 71
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.34.110
Xref: solutions.advantagedatabase.com Advantage.Trigger:299
Article PK: 1136366

Maaz,

when using replication the only trigger to fire will be the "Conflict"
trigger type.

---- Snip from Help file -----
When a replication update is performed at the target database, the only
trigger type that will be executed is the CONFLICT trigger. The reason
for this is because triggers can write different data to the record than
is provided in the original update. If the trigger at the target were
fired, it would be using different data than was available at the
source. Replication will distribute that actual data that is written at
the source to the target.
--- /Snip ---

Be sure to include all tables in replication (Base table, and any other
tables updated by triggers). Then each table will replicate the changes.

Edgar Sherman
Advantage Support

Maaz Rizki wrote:
> Hi Folks,
>
> I wrote following trigger, this trigger have strange behavior, that is it
> sometime works and some time it does not work. It is on Insert only. The
> source file "COSTFILE" is get new records via Replication. However when I do
> manual test work just fine.
>
> Do anybody have any idea what might be going on.
>
> ----------------------------------------------------------------------------
> --
>
> CREATE TRIGGER Insert_Into_NewItems
>
> ON COSTFILE
>
> AFTER
>
> INSERT
>
> BEGIN
>
> insert into "\\172.16.7.7\c$\DB\BackOffice\BackOffice.Add".NewItems (
>
> Vendor_Id,Isbn,Descript,VendorItem,No_IN_Case,Cost_Each,Size,Measure,Dept,[G
> roup],Order_Num,Post_Date,Post_Time)
>
> select
> a.Vendor_Id,Isbn,Descript,VendorItem,No_In_Case,Cost_Each,Size,Measure,Dept,
> [Group],iif(b.AutoAssignOrder_Num=True,Trim(a.Vendor_Id)+Dept,Null)
> Order_Num,Current_Date(),Current_Time() from __New a
>
> inner join Vendor b
>
> on a.Vendor_Id=b.Vendor_Id;
>
> END
>
> PRIORITY 1;
>
> Seasons Greeting,
>
> Regards,
>
> Maaz Rizki
>
>
>
>