Question

  Asked: May 18 2008   6:32 AM GMT
  Asked by: Lokanath


How to explicitely Lock a record of a file in a SQLRPGLE program using embeded SQLs?


Record lock, Embedded SQL, SQLRPGLE

How to explicitely Lock a record of a file in a SQLRPGLE program using embeded SQLs?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



Make the Select statement with the "For Update" clause, this way the record(s) selected will be locked until the Cursor releases it:

Declare MyCursor For

Select *
From MyFile
Where MyCondition
For Update

...

Close MyCursor

Regards,

Gerardo
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400 and Database.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register