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.

Before Update to Insert record

3 posts in Trigger Last posting was on 2005-04-05 08:26:30.0Z
Oskar Schneider Posted on 2005-04-05 02:06:28.0Z
From: "Oskar Schneider" <Oskar@atk-it.com>
Newsgroups: Advantage.Trigger
Subject: Before Update to Insert record
Date: Mon, 4 Apr 2005 19:06:28 -0700
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 66.15.153.8
Message-ID: <4251f414@solutions.advantagedatabase.com>
X-Trace: 4 Apr 2005 20:12:36 -0700, 66.15.153.8
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!66.15.153.8
Xref: solutions.advantagedatabase.com Advantage.Trigger:159
Article PK: 1136225

hi,

I need to keep some tables on a remote server synced with local tables

in my app I am coding like

( pseudocode)

update or insert local table
get PK from local table

check remote table for PK
if exists remote PK
update remote table
else
insert into remote table
endif
done

works OK, however as the connection to the remote table may be slow I was
thinking about a before update trigger script which might do the job

However I am stuck as I cannot find support for If then else within a script

Any ideas?
Oskar


Joachim Duerr (ADS Support) Posted on 2005-04-05 08:26:30.0Z
From: "Joachim Duerr (ADS Support)" <jojo.duerr@gmx.de>
Subject: Re: Before Update to Insert record
Newsgroups: Advantage.Trigger
References: <4251f414@solutions.advantagedatabase.com>
Organization: Extended Systems GmbH
User-Agent: XanaNews/1.17.3.1
X-Face: ,QMv7[luB)BpWAQ~:"kw6n%0ieY63.:g2K3n~8ky0;||5Xle*Xq+=~<Fy:0CVC2nx@8~vZ
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 195.2.185.25
Message-ID: <42523da6@solutions.advantagedatabase.com>
Date: 5 Apr 2005 01:26:30 -0700
X-Trace: 5 Apr 2005 01:26:30 -0700, 195.2.185.25
Lines: 39
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!195.2.185.25
Xref: solutions.advantagedatabase.com Advantage.Trigger:160
Article PK: 1136227


Oskar Schneider wrote in <4251f414@solutions.advantagedatabase.com> :

> I need to keep some tables on a remote server synced with local tables
>
> in my app I am coding like
>
> ( pseudocode)
>
> update or insert local table
> get PK from local table
>
> check remote table for PK
> if exists remote PK
> update remote table
> else
> insert into remote table
> endif
> done
>
> works OK, however as the connection to the remote table may be slow I
> was thinking about a before update trigger script which might do the
> job

Another idea:
Write a trigger which inserts the primary key and the event into a
shadow table, write a service which reads the shadow table asynchron
and sends the data to the remote server.

> However I am stuck as I cannot find support for If then else within a
> script

This will come with Version 8.

--
Joachim Duerr
EMEA Lead ADS Support, Extended Systems GmbH, Germany
advantage[AT]extendsys.de
Join the European Advantage Conference 2005!
http://www.extendedsystems.com/go/eac2005


Thomas Steinmaurer <t.steinmaurer Posted on 2005-04-05 08:08:50.0Z
Date: Tue, 05 Apr 2005 10:08:50 +0200
From: Thomas Steinmaurer <t.steinmaurer@_no_upscene_spam_.com>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Before Update to Insert record
References: <4251f414@solutions.advantagedatabase.com> <42523da6@solutions.advantagedatabase.com>
In-Reply-To: <42523da6@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 140.78.93.2
Message-ID: <425248ce@solutions.advantagedatabase.com>
X-Trace: 5 Apr 2005 02:14:06 -0700, 140.78.93.2
Lines: 44
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!140.78.93.2
Xref: solutions.advantagedatabase.com Advantage.Trigger:161
Article PK: 1136226


>>I need to keep some tables on a remote server synced with local tables
>>
>>in my app I am coding like
>>
>>( pseudocode)
>>
>>update or insert local table
>>get PK from local table
>>
>>check remote table for PK
>>if exists remote PK
>> update remote table
>>else
>> insert into remote table
>>endif
>>done
>>
>>works OK, however as the connection to the remote table may be slow I
>>was thinking about a before update trigger script which might do the
>>job
>
>
> Another idea:
> Write a trigger which inserts the primary key and the event into a
> shadow table, write a service which reads the shadow table asynchron
> and sends the data to the remote server.

To maintain a shadow or log table, ADS LogManager might be a great help
here: http://www.upscene.com

Currently we don't have a "Redo" facility to apply logged operations on
another database. This is something one needs to implement. We at
Upscene might be able to offer something similar in the future though.



--
HTH,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2 (NEW!)
Upscene Productions
http://www.upscene.com