Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread SQL Update queries do not update LastAutoInc
Wed, May 30 2007 1:54 PMPermanent Link

Michael Shannon
Hello,

In DBISAM 4.2x, executing an SQL statement similar to the following does not update the LastAutoInc value for the table:
   UPDATE TableName SET ID = (ID + 1000)
ID is primary key of AutoInc type.

"Regular" non-SQL editing of the ID value WOULD auto-set LastAutoInc appropriately (as mentioned here: http://www.elevatesoft.com/scripts/newsgrp.dll?
action=openmsg&group=5&msg=47994&page=1#msg47994), so shouldn't the query do the same for consistency?

Thank you,

Michael Shannon
Thu, May 31 2007 3:20 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< In DBISAM 4.2x, executing an SQL statement similar to the following does
not update the LastAutoInc value for the table:
   UPDATE TableName SET ID = (ID + 1000)
ID is primary key of AutoInc type.

"Regular" non-SQL editing of the ID value WOULD auto-set LastAutoInc
appropriately >>

You are assigning the autoinc column a value manually.  In such a case,
DBISAM will not increment the auto-increment value for the column.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Jun 1 2007 8:58 AMPermanent Link

Michael Shannon
Okay Tim, thanks for the info. I can't say that I see this behavior as logical (since the similarly manual assignment, e.g., via GUI, *does* auto-increment
LastAutoInc - as I mentioned in my original post), but no problem, just something one needs to be aware of.

Thanks,

Michael Shannon
Fri, Jun 1 2007 3:42 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michal,

<< Okay Tim, thanks for the info. I can't say that I see this behavior as
logical (since the similarly manual assignment, e.g., via GUI, *does*
auto-increment LastAutoInc - as I mentioned in my original post), but no
problem, just something one needs to be aware of. >>

I mis-understood what you were saying because I didn't read the link and I
thought that I understood the question to entail the auto-inc values in the
columns, not the last auto-inc value for the table.

That post from 2005 is no longer accurate, and I'm not sure if it was ever
accurate.  The latest 4.x versions only increment the last auto-increment
value when inserting rows.  They do not touch the last auto-increment value
when modifying rows.  That's the way it always should have been.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image