× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 11/14/2011 9:12 AM, Jerry C. Adams wrote:
If one uses READ(n) or CHAIN(n) against a table that has been defined for
update, can one still use the UPDATE or DELETE op-codes against the
retrieved record. All that the manual says is that the record is retrieved
without locking it. It would seem to me that, since the program has the
record, it could still be updated or deleted.

You can't update a record unless you have a lock on it.

From the 5.4 RPG reference ...

"Before UPDATE is issued to a file or record, a valid input operation with lock (READ, READC, READE, READP, READPE, CHAIN, or primary/secondary file) must be issued to the same file or record."

So if you don't have a lock on the record, you can't update it.

As for delete ... you can delete records directly using a search arg ... but, if you don't specify a search arg, the current record is deleted. Also from the RPG ref: "The record must have been locked by a previous input operation (for example, CHAIN or READ)"

david


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.