Re: (no subject)
Mike Aubury <[email protected]> Thu, 24 Jun 2021 20:26:08 +0100
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <CAGAq4WEHaPxed8Ud29BVyzZpSkNPbzwYD_hAtfN=eSYUX8WC7Q@mail.gmail.com> |
You'd need to take that up with Informix! Its never been good practice to use rowid as a unique key, all tables should have a primary key, and that should be used for updates and deletes. In rare cases, it's not possible to have a pk and then the rowid can be used as a backstop. On Thu, 24 Jun 2021, 19:12 James B. Byrne via Aubit4gl-discuss, < [email protected]> wrote: > > > On Thu, June 24, 2021 13:05, Mike Aubury wrote: > > Aubit4GL shouldnt need an oid column, the oid column is only mainly to > > replicate the ROWID functionality of Informix. > > If you dont use the ROWID but use a proper primary key, you shouldn't > need > > a separate OID column > > > > That said - you can use the "THRU" syntax to pick a range of columns > > > > DISPLAY BY NAME gr_customer.customer_num THRU gr_customer.phone > > > > > > > > > The ROWID was introduced in the series of examples in "4GL by Example" in > exercise 10. It is used to confirm a delete. That is the only reason > that I > added oids. In my prior experience I would simply use a table id column > instead. > > So, the question becomes why would the recommended delete process for > Informix4GL use ROWID in place of the table id (customer_num/manu_code) > sequenced column? > > > This is the code from the example where ROWID is employed: > > ######################################## > FUNCTION verify_rowid(mrowid, code_in_mem) -- ex10 tags 73 - 75 > ######################################## > DEFINE mrowid INTEGER > > DEFINE code_in_mem LIKE manufact.manu_code, > code_on_disk LIKE manufact.manu_code > > SELECT manu_code > INTO code_on_disk > FROM manufact > WHERE ROWID = mrowid > > IF (status == NOTFOUND) > OR > (code_on_disk <> code_in_mem) > THEN > ERROR " Manufacturer: ", > code_in_mem, > " has been deleted by another user." > RETURN(FALSE) -- NOT OK to proceed > END IF > > RETURN(TRUE) -- OK to proceed > > END FUNCTION -- verify_rowid(mrowid, code_in_mem) -- > #### > > > -- > *** e-Mail is NOT a SECURE channel *** > Do NOT transmit sensitive data via e-Mail > Unencrypted messages have no legal claim to privacy > Do NOT open attachments nor follow links sent by e-Mail > > James B. Byrne mailto:[email protected] > Harte & Lyne Limited http://www.harte-lyne.ca > 9 Brockley Drive vox: +1 905 561 1241 > Hamilton, Ontario fax: +1 905 561 0757 > Canada L8E 3C3 > > > > _______________________________________________ > Aubit4gl-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss > _______________________________________________ Aubit4gl-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss