|
Hi Mohammed, 1. if you use a cursor, the record gets automatically locked executing the fetch statement. But it's only locked if you have an UPDATE-Statement with WHERE CURRENT OF for the Cursor. If there is no update statement, the record will not be locked at the fetch statement. Specifying FOR READ ONLY or FOR FETCH ONLY does not affect the behavior of locking a record. If a cursor is updateable or deletable and FOR FETCH ONLY is not specified, blocking may not be used by the database manager and exclusive locks may not be avoided. 2. If none of your files/tables is journaled, add a SET OPTION-Statement as follows: C/EXEC SQL Set Option Commit = *NONE C/End-Exec If you only want specific updates, inserts or deletes not committed, just add WITH NC to the statement. Birgitta -----Ursprungliche Nachricht----- Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]Im Auftrag von Mohammad, Tanveer Gesendet: Samstag, 24. September 2005 01:06 An: RPG programming on the AS400 / iSeries Betreff: Record Locking SQLRPGLE I want to read a record and update some values using SQLRPGLE and I want to make sure that I lock the record before updating it. Just like CHAIN and UPDATE operation code. Do I have to SET something in OPTIONS? Also I don't want my files to be journaled to do that. Thanks -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.