Home > Archive > SQL Anywhere database replication > April 2005 > How to stop deletions from being replicated









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to stop deletions from being replicated
Oleg

2005-04-25, 9:23 am

Hello All,

I have a situation that I make inserts and deletes on a table, but the
deletes should NOT be replicated (or even logged for it), whereas the
inserts should be. My publication has many tables, but one only requires
such a thing.

I guess the situation is quite common when some sort of data archiving in
the remote database occurs - the deletions at remote database should not
cause deletions at the consolidated one, etc.

Can anyone help me with it please?

Many thanks,


Reg Domaratzki \(iAnywhere Solutions\)

2005-04-25, 11:23 am

With SQL Remote, you cannot choose to only replicate inserts and updates and
not deletes. My best suggestion would be to add a delete trigger on
consolidated to archive the row to another table before the row is deleted.

--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup

iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set "Platform Preview" and "Time Frame" to ALL

"Oleg" <olegshavrin@sandmar.co.uk> wrote in message
news:426cf255$1@foru
ms-1-dub...
> Hello All,
>
> I have a situation that I make inserts and deletes on a table, but the
> deletes should NOT be replicated (or even logged for it), whereas the
> inserts should be. My publication has many tables, but one only requires
> such a thing.
>
> I guess the situation is quite common when some sort of data archiving in
> the remote database occurs - the deletions at remote database should not
> cause deletions at the consolidated one, etc.
>
> Can anyone help me with it please?
>
> Many thanks,
>
>



Oleg

2005-04-26, 11:24 am

Would it be possible to have an example of the syntax creating such a
trigger please?


"Oleg" <olegshavrin@sandmar.co.uk> wrote in message
news:426cf255$1@foru
ms-1-dub...
> Hello All,
>
> I have a situation that I make inserts and deletes on a table, but the
> deletes should NOT be replicated (or even logged for it), whereas the
> inserts should be. My publication has many tables, but one only requires
> such a thing.
>
> I guess the situation is quite common when some sort of data archiving in
> the remote database occurs - the deletions at remote database should not
> cause deletions at the consolidated one, etc.
>
> Can anyone help me with it please?
>
> Many thanks,
>
>



Reg Domaratzki \(iAnywhere Solutions\)

2005-04-26, 11:24 am

create table t1 ( pkey bigint default global autoincrement primary key, c1
integer );
create table t1_archive ( pkey bigint primary key, c1 integer );

create trigger ad_t1 after delete on t1
referencing old as old_row for each row
begin
insert into t1_archive values ( old_row.pkey, old_row.c1 );
end;


--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup

iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set "Platform Preview" and "Time Frame" to ALL

"Oleg" <olegshavrin@sandmar.co.uk> wrote in message
news:426e6948$1@foru
ms-1-dub...
> Would it be possible to have an example of the syntax creating such a
> trigger please?
>
>
> "Oleg" <olegshavrin@sandmar.co.uk> wrote in message
> news:426cf255$1@foru
ms-1-dub...
in[color=darkred]
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com