Hi James. Welcome to the community. Unfortunately in the current Informix engine, the ROWID is not an ordinal row number but the row's actual address within the table. It consists of the ordinal page number in the first 24 bits and the row's slot number on the page in the last byte. So, the first row in any table is 0x00000101 or 257. Vis:
> select first 5 rowid, hex(rowid) from extents;
rowid (expression)
257 0x00000101
258 0x00000102
259 0x00000103
260 0x00000104
261 0x00000105
So, rows stored on the table's second page would have rowids starting at 0x00000201 or 513. Since each page by default holds 2020 bytes of data, there will normally be fewer than 255 rows on a page, so there will be numbering gaps between the last rowid on one page and the first rowid on the next page in the table.
So there is no way to change that. It sounds like the original system was written for the original Informix engine, which for a time was known as the Informix Standard Engine, or SE, which would have been Informix versions up to 3.10. In SE, the ROWID pseudo-column was indeed an ordinal starting at 1. Starting with the Informix Turbo Engine v4.00 and Informix OnLine v5.01 rowids have been handled like this.
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com------------------------------
Original Message:
Sent: Fri September 22, 2023 08:37 AM
From: James Hughes
Subject: ROWID question
I am working part time at a small consulting firm. They had a very old version of Informix with a 4GL interface dating back probably 20 years that hadn't been updated. There's a lot of code and almost all the searches are configured using ROWID. I've set up a VM using a modern version of Centos, upgraded to a current version of Informix, moved over the data, and recompiled the code. All seems well except that the new tables all start at rowid 257 instead of 1. I know using rowid isn't a good way to do things, and I'll start going through the code fixing that, but there's a lot of code and I'm only one part time guy. Is there a way to change the tables to start at rowid 1 in the meantime while I start unraveling all this old code? Tables are unfragemented. Any help greatly appreciated.
------------------------------
James Hughes
------------------------------