Reply to Re: IDENT_CURRENT and empty table

Your name:

Reply:


Posted by helmut woess on 09/18/05 18:51

Am 18 Sep 2005 07:57:39 -0700 schrieb --CELKO--:

>>> But if i check the IDENT_CURRENT from a newly created table the result should be NULL, or not? <<
>
> What would a NULL value mean? Why not zero? Remember IDENTITY is
> proprietary and non-relational, so it can do anything it wants.
>
> Think about how it would work if you had a 1950's sequential tape file
> system. The counter starts at one and is incremented after the
> insertion instead of before. It is the position of the read/write head
> of the maganeitc tape drive.

We have NULL to mark something as unknown. Why not using it?
In the manual IDENT_CURRENT is described as "gives back the last generated
ident value". So from my logical point of view it cannot give back a value
if it has not generated a value before. And because zero can be a valid
starting value it can't give back zero.
Maybe it would be better we have a IDENT_NEXT which shows the next value
which will be used, instead of IDENT_CURRENT. This could avoid such
misconception.

bye,
Helmut

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация