Re: ROWIDs on fragmented tables and ESQL/C Updates
Posted in 1995
The ISQL limitation is the primary reason for the WITH ROWIDS option existing at all -- that, and all the other people's code that used ROWID. It is a known limitation, though I fear that the OnLine documentation wouldn't list it, even though it is the change to OnLine which is breaking older ISQL. I'm intrigued that your table doesn't have a serial column on it, but it evidently doesn't. You cannot update SERIAL columns either. And in pre-7.1x SQL, you could not update ROWID, so you shouldn't be able to do so now. Your technique for handling the update is the 'officially approved' method; see any of CJ Date's books, for example, on using SQL. Basically, using '*' should, in general, be limited to interactive use; programs should use explicit column lists to protect themselves from changes in the database schema. This is the principal argument against using 'RECORD LIKE Table.*' in I4GL, though there are other factors which make it convenient to use (amongst others, it often makes the code easier to maintain because I4GL lacks a civilized type-defining system) provided the risks are understood. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: Dick Counsell <dickc@wrq.com> }Date: 8 Dec 1995 18:12:26 GMT }X-Informix-List-Id: <news.19554> } }We have a table that is distributed across two dbspaces. By default }Informix does not assign rowids to fragmented tables. This was causing }us a problem with isql forms because they apparantly explicitly select }rowids. I didn't understand why an Informix front-end tool wouldn't work }with the new Informix engine, but figured I would just add rowids to the }table. } }Then we had a problem with some of our ESQL/C calls. We were doing }updates like this: } } $ update orders } set * = ($ORRec) } where or_order_num = $ORRec.or_order_num; } }Well, apparently "*" now includes rowid on fragmented tables that have }had rowid added (although it doesn't show up when you look at column }names). We started getting errors that the number of columns being }updated didn't match the number of values. } }We have worked around this for the time being by individually specifying }each column name rather than "*". } }Has anyone else experienced this? Do you have a better solution?