ROWIDs ???
Posted in 2001
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
Version 7.31 OS: AIX 4.3.3 I am fairly new to the Informix 4GL world and notice a lot of the extant programs use ROWID to access/update rows in tables. Is this considered a good programming practice? (Ingres had the concept of TIDs - tuple IDs - but dtrongly recommended against their use.) It would seem to be a better practice to use a primary key (e.g., employee number) instead... comments? Thank you, Lucky Lucky Leavell Phone: (800) 481-2393 or (812) 366-4066 UniXpress - Your Source for SCO FAX: (888) 231-9640 or (812) 366-3618 1560 Zoar Church Road NE Email: lucky@UniXpress.com Corydon, IN 47112-7374 WWW Home Page: http://www.UniXpress.com
"Lucky Leavell [RIS]" wrote: > > Version 7.31 > OS: AIX 4.3.3 > > I am fairly new to the Informix 4GL world and notice a lot of the extant > programs use ROWID to access/update rows in tables. Is this considered a > good programming practice? (Ingres had the concept of TIDs - tuple IDs - > but dtrongly recommended against their use.) It would seem to be a better > practice to use a primary key (e.g., employee number) instead... comments? > > Thank you, > Lucky Using rowids is widely considered to be a bad idea. It's much better to define a primary key. For one thing, rowids are not guaranteed to be unique (in a fragmented table there can be duplicate rowids). The primary key has other advantages - you can build constraints around it to enforce referential integrity for instance. If deja.com is working a power search on rowid should provide some more informative (and informed) opinions. -- So Archimedes Plutonium is tied to a stake in the backyard, and sleeping in his kennel. K*bo tiptoes up (carrying a dustbin lid) and measures the length of the chain Arch is tied to, then marks a radius on the ground...
Lucky Leavell [RIS] wrote in message ... > >I am fairly new to the Informix 4GL world and notice a lot of the extant >programs use ROWID to access/update rows in tables. Is this considered a >good programming practice? (Ingres had the concept of TIDs - tuple IDs - >but dtrongly recommended against their use.) It would seem to be a better >practice to use a primary key (e.g., employee number) instead... comments? > This is a real whinge I've got with Informix rewriting history. They used to call rowid's the greatest thing since sliced bread for optimising some operations and simplifying repetitious programming - and are especially useful in code generators and generic libraries. NOW - since they invented some wonderful new technology involving fragmentation of tables, and since it was too much hard work to implement decent rowids on such tables, all of a sudden rowid's are nastier than a Jerry Springer guest. It just doesn't seem right. If they'd contemplate extending 4GL with flexible records so I can pass different-shaped PK's to library routines I'd be much happier, and whinge less. There were some rules about rowid's that you had to follow, like NOT trusting them to stay the same between transactions, and NEVER store them anywhere, but apart from that, they were just a bread-n-butter programming technique until Big Brother reminded us all that they are really really bad. 1984 isn't that far away... If you dream of writing code that is portable to other database engines, then rowid's don't exist on many others (Oracle has them but they are char(18)) and thus they can be considered non-portable. They are probably NOT standard SQL... -- "It seems someone's been a bad boy and blew up a building he shouldn't have..." - Frank Drebin, Naked Gun.
"Andrew Hamm" <ahamm@sanderson.net.au> writes: > This is a real whinge I've got with Informix rewriting history. They used to > call rowid's the greatest thing since sliced bread for optimising some > operations and simplifying repetitious programming - and are especially > useful in code generators and generic libraries. If Informix jumped off a cliff, *I* sure wouldn't follow! -- Forte International, P.O. Box 1412, Ridgecrest, CA 93556-1412 Ronald Cole <ronald@forte-intl.com> Phone: (760) 499-9142 President, CEO Fax: (760) 499-9152 My GPG fingerprint: C3AF 4BE9 BEA6 F1C2 B084 4A88 8851 E6C8 69E3 B00B
Ronald Cole wrote in message ... >"Andrew Hamm" <ahamm@sanderson.net.au> writes: >> This is a real whinge I've got with Informix rewriting history. They used to >> call rowid's the greatest thing since sliced bread for optimising some >> operations and simplifying repetitious programming - and are especially >> useful in code generators and generic libraries. > >If Informix jumped off a cliff, *I* sure wouldn't follow! > Hmmm - not sure if this is a criticism of Informix rewriting history, or the poor fools who followed their original advice. If the second, well, I wasn't equipped with a Crystal report^H^H^H^H^H^H ball all those years ago, so call me a sucker if my retrospectoscope didn't come with a futurehindsight option.
"Andrew Hamm" <ahamm@sanderson.net.au> writes: > Hmmm - not sure if this is a criticism of Informix rewriting history, or the > poor fools who followed their original advice. If the second, well, I wasn't > equipped with a Crystal report^H^H^H^H^H^H ball all those years ago, so call > me a sucker if my retrospectoscope didn't come with a futurehindsight > option. I cut my teeth on Unify. When I looked at Informix, the rowid thing was all the rage. I avoided it because I knew better. Shame on Informix. ;) -- Forte International, P.O. Box 1412, Ridgecrest, CA 93556-1412 Ronald Cole <ronald@forte-intl.com> Phone: (760) 499-9142 President, CEO Fax: (760) 499-9152 My GPG fingerprint: C3AF 4BE9 BEA6 F1C2 B084 4A88 8851 E6C8 69E3 B00B