Re:
Posted in 1999
Rekaish Bhardwaj wrote: > > Hello everyone. > > This is just a minor problem but I'm curious about a possible answer. > > I have a table which I drop, recreate and insert a row. > I then do a select of the rowid of this row which turns out not to be 1. > Is this how its supposed to work. > How do I get a rowid of 1 ? > I do not normally use rowids especially V6/7, > but I'm working on an old system which still uses them > > Informix SQL 6.05 on AIX 4.1.5 You don't indicate which database server you are using, but I will assume OnLine or IDS. The simple answer is, the rowid will never be one. This was possible in SE, because the rowid was simply the offset into the data file. But with OnLine and IDS the rowid is formed from the page number and the slot number. The moral of the story is, at worst, never assume rowid values. At best, don't use them, rather use the primary key. If you have partitioned (fragmented) your table, then NEVER use rowids. Because of the way a rowid is formed, it is possible to get duplicate values from different dbspaces. Hope this helps, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com http://www.informix.com/idn |///// / //| |http://www.iiug.org +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 838250 2325 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+