AS/400 – SQL

1215 pts.
Tags:
AS/400
SQL
SQL statements
I am reading a record in SQL with No Lock and its getting displayed in Screen. Based on the user input, I will/won't update the record. I want to check the record lock before performing the update statement. I don't want to check the SQL code after performing the update statement. What I want is: I want to check the record lock while selecting the record in read only mode itself (in SQL). Please help me to check the record lock.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    You can't. It's not how it's done. Programs don't work in ways that you simply want them to work; they work in ways that the system is designed to work. You can't check a record lock in read-only mode, primarily because there is no reason for the system to report a record lock in read-only mode. Records aren't locked for read-only mode. There is no lock to check. Locks are for updates. . Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    BTW, if this is a single-record-at-a-time interactive maintenance function, it doesn't make a lot of sense to do it with SQL. SQL is much better suited for handling sets of records at a time rather than specific individual records. Native record-level access is probably a better choice (unless this file is only available to SQL for some reason). . Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    In SQL .. here is what I think .. once you've decided to Update then issue a second select ... for Update. Check the SQL code from that select and then you can do the Update SQL. Phil
    50,605 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following