To: "'Midrange Systems Technical Discussion'" <midrange-l@xxxxxxxxxxxx>
Date: Fri, 28 Dec 2012 10:54:27 -0800
Subject: Uniquely identifying a record in SQL without a unique key?
I'm beginning to study Scott Klement's JDBCR4 API, as a means of extending
our QuestView product to access external databases (and it would also allow
us to expand our very limited support of data types that are normally
SQL-only), and something suddenly struck me:
Suppose I'm looking at a record, and I decide to make a change to it. And
the file isn't uniquely keyed.
Now, with native RLA, we can easily determine the RRN of the record we're
looking at, and acquire an update lock on that record by its RRN. After
all, RRNs only change if a RGZPFM is done, and that requires an exclusive
lock on the member.
But now, suppose I have to use SQL, JDBC, and the JDBCR4 API. I'm no
expert on SQL (SQL for Dummies is still my primary reference on the
subject), but I don't recall ever reading anything anywhere about a way to
get a record's RRN, or retrieve a record by its RRN, from SQL.
I must be missing *something* here, but what? How do I guarantee that an
update will go to the right record, when I initially read it without a
lock, and apparently can't grab a lock on it by its RRN?
This mailing list archive is Copyright 1997-2013 by MIDRANGE dot 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 here. If you have questions about this, please contact