Home > Archive > SQL Anywhere Feedback > February 2006 > TRUNCATE TABLE documentation









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 TRUNCATE TABLE documentation
Pavel Karady

2006-02-03, 7:23 am

In the new documentation, the fact that TRUNCATE TABLE row deletion is not
written into transaction log should be underlined two times with a thick red
line and framed in a gothic frame box with many !s around. Could save hours
of searching for the cause of "SQL statement failed: (-193) Primary key for
table %1 is not unique" agent log messages.

Pavel


krisztian pinter

2006-02-03, 7:23 am

On 3 Feb 2006 02:26:38 -0800, Pavel Karady =

<pavel_ns. ns_karady@ns_kogerus
a.com> wrote:

> In the new documentation, the fact that TRUNCATE TABLE row deletion is=

=

> not
> written into transaction log should be underlined two times with a thi=

ck =

> red
> line


what about changing the syntax to

TRUNCATE TABLE <tablename> AT MY OWN RISK
Pavel Karady

2006-02-03, 7:23 am

"krisztian pinter" <pinterkr@freemail.hu> wrote in message
news:ops4d5djf7wwfeh
v@karwst_pint...
>what about changing the syntax to
>TRUNCATE TABLE <tablename> AT MY OWN RISK


An excellent suggestion :)

Pavel


Breck Carter [TeamSybase]

2006-02-03, 9:23 am

On 3 Feb 2006 02:26:38 -0800, "Pavel Karady"
<pavel_ns. ns_karady@ns_kogerus
a.com> wrote:

>In the new documentation, the fact that TRUNCATE TABLE row deletion is not
>written into transaction log should be underlined two times with a thick red
>line and framed in a gothic frame box with many !s around. Could save hours
>of searching for the cause of "SQL statement failed: (-193) Primary key for
>table %1 is not unique" agent log messages.


What does TRUNCATE TABLE have to do with that error message?

Breck

--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
David Fishburn

2006-02-03, 9:23 am

"Pavel Karady" <pavel_ns. ns_karady@ns_kogerus
a.com> wrote in
news:43e320fa@forums
-2-dub of
sybase.public.sqlanywhere. product_futures_disc
ussion:


I sent a note to the doc team to indicate this statement should not be
used on a replicating or synchronizing database.

--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).

EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm

Developer Community / Whitepapers
http://www.ianywhere.com/developer

CaseXpress - to report bugs
http://casexpress.sybase.com

CodeXchange - Free samples
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]

Breck Carter [TeamSybase]

2006-02-03, 9:23 am

The Help for TRUNCATE TABLE already says "Do not use this statement in
SQL Remote replication or on a MobiLink remote database."

It also says "...each individual row deletion is not entered into the
transaction log." in the second sentence.

I am all for improving the Help, but I am trying to understand how
TRUNCATE TABLE not being logged will cause a primary key violation,
replicating or otherwise.

Breck

On 3 Feb 2006 07:39:05 -0800, David Fishburn
<fishburn_spam@off.ianywhere.com> wrote:

>"Pavel Karady" <pavel_ns. ns_karady@ns_kogerus
a.com> wrote in
> news:43e320fa@forums
-2-dub of
>sybase.public.sqlanywhere. product_futures_disc
ussion:
>
>
>I sent a note to the doc team to indicate this statement should not be
>used on a replicating or synchronizing database.


--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
Reg Domaratzki \(iAnywhere Solutions\)

2006-02-03, 11:23 am

On remote :

insert into t1 values (1, ... )
synch/replicate;
Truncate table t1;
synch/replicate;
insert into t1 values (1, ... )
synch/replicate;

You should get a primary key violation on the consolidated, since the row
with pkey=1 was never deleted there.

--
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/swd/base.do
-> Choose SQL Anywhere Studio
-> Set filter to "Display ALL platforms IN ALL MONTHS"


"Breck Carter [TeamSybase]" < NOSPAM__bcarter@risi
ngroad.com> wrote in
message news:7tq6u1hd8nijqqg
4vba6jcusd3hjglbtm6@
4ax.com...
> The Help for TRUNCATE TABLE already says "Do not use this statement in
> SQL Remote replication or on a MobiLink remote database."
>
> It also says "...each individual row deletion is not entered into the
> transaction log." in the second sentence.
>
> I am all for improving the Help, but I am trying to understand how
> TRUNCATE TABLE not being logged will cause a primary key violation,
> replicating or otherwise.
>
> Breck
>
> On 3 Feb 2006 07:39:05 -0800, David Fishburn
> <fishburn_spam@off.ianywhere.com> wrote:
>
>
> --
> SQL Anywhere Studio 9 Developer's Guide
> Buy the book:

http://www.amazon.com/exec/obidos/A...7/risingroad-20
> bcarter@risingroad.com
> RisingRoad SQL Anywhere and MobiLink Professional Services
> www.risingroad.com



Pavel Karady

2006-02-06, 3:23 am

"Breck Carter [TeamSybase]" < NOSPAM__bcarter@risi
ngroad.com> wrote in
message news:7tq6u1hd8nijqqg
4vba6jcusd3hjglbtm6@
4ax.com...
> The Help for TRUNCATE TABLE already says "Do not use this statement in
> SQL Remote replication or on a MobiLink remote database."
>
> It also says "...each individual row deletion is not entered into the
> transaction log." in the second sentence.


Yes, and I've found these sayings few minutes after starting this thread. So
it's all in the docs, that great, but I still think the single sentence
"..., so *the TRUNCATE TABLE operation is not replicated*" should be
surrounded by Las Vegas lights with some pyrotechnics involved (the gothic
frame with red double underline remains).

In speed development environment of these days, I bet 99% of the youngsters
(including me) reading the docs do not get down to this *important* part
that's buried deep in the text.

Breck - in a replication environment, imagine you have a table that's
identical in the structure and data in two databases. Then you use TRUNCATE
TABLE on one of them and try to refill it again. The agent replicates these
INSERTs, but they return an error on the remote db, since the effect of
TRUNCATE TABLE was never replicated.


Thank you guys for your responses. The're really valued!
Pavel


krisztian pinter

2006-02-06, 3:23 am

On 6 Feb 2006 01:06:25 -0800, Pavel Karady =

<pavel_ns. ns_karady@ns_kogerus
a.com> wrote:


> Yes, and I've found these sayings few minutes after starting this =


> thread. So
> it's all in the docs, that great, but I still think the single sentenc=

e
> "..., so *the TRUNCATE TABLE operation is not replicated*" should be
> surrounded by Las Vegas lights with some pyrotechnics involved (the =


> gothic frame with red double underline remains).



sue Sybase! :)
Pavel Karady

2006-02-06, 7:23 am

"krisztian pinter" <pinterkr@freemail.hu> wrote in message
news:ops4jlh3qkwwfeh
v@karwst_pint...

> sue Sybase! :)


It would be like suing my mother :)
Pavel


Paul Horan[TeamSybase]

2006-02-06, 9:23 am

"Reg Domaratzki (iAnywhere Solutions)" <FirstName.LastName@ianywhere.com>
wrote in message news:43e750a6@forums
-2-dub...
> Pavel, would the attached image be a sufficient addition to the docs? :)
>
> --
> Reg Domaratzki, Sybase iAnywhere Solutions
> Sybase Certified Professional - Sybase ASA Developer Version 8
> Please reply only to the newsgroup
>



Looking forward to TechWave2006, are we?? ;)

Paul Horan


Pavel Karady

2006-02-08, 11:23 am

Reg, post after post, you're getting more amazing :)

Pavel

"Reg Domaratzki (iAnywhere Solutions)" <FirstName.LastName@ianywhere.com>
wrote in message news:43e750a6@forums
-2-dub...
> Pavel, would the attached image be a sufficient addition to the docs? :)
>
> --
> 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/swd/base.do
> -> Choose SQL Anywhere Studio
> -> Set filter to "Display ALL platforms IN ALL MONTHS"
>
>
> "Pavel Karady" <pavel_ns. ns_karady@ns_kogerus
a.com> wrote in message
> news:43e71191$1@foru
ms-1-dub...
> So
> youngsters
> TRUNCATE
> these
>
>
>



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