DATA Step, Macro, Functions and more

Converting SAS DB2 to Oracle - dealing with record locks

Accepted Solution Solved
Reply
Established User
Posts: 1
Accepted Solution

Converting SAS DB2 to Oracle - dealing with record locks

I'm converting SAS code with PROC SQL statements where the back end is moving from DB2 to Oracle.  My Base SAS is 9.4

 

The existing DB2 statements use FOR FETCH ONLY WITH UR, which I understand allows this code to avoid record locks with other users and potentially accepts some "out of date" data when accessing records which others may be simultaneously updating.

 

In the Oracle environment will the LIBNAME option READ_LOCK_TYPE=NOLOCK provide the equivalent locking control?


Accepted Solutions
Solution
‎09-25-2017 11:26 AM
Regular Learner
Posts: 1

Re: Converting SAS DB2 to Oracle - dealing with record locks

Posted in reply to MarkParent

FOR FETCH ONLY WITH UR is IBM DB2-code for fetching uncommited changes from other sessions.

 

FOR FETCH ONLY - means the cursor is read only, issues different types of locks and does not allow for update. 
WITH UR - means instead of retrieving only committed work, your SELECT or FETCH will also retrieve rows that have not been committed by other tasks.

 

 

This sort of "Dirty reads" is not allowed in Oracle.

 

View solution in original post


All Replies
Solution
‎09-25-2017 11:26 AM
Regular Learner
Posts: 1

Re: Converting SAS DB2 to Oracle - dealing with record locks

Posted in reply to MarkParent

FOR FETCH ONLY WITH UR is IBM DB2-code for fetching uncommited changes from other sessions.

 

FOR FETCH ONLY - means the cursor is read only, issues different types of locks and does not allow for update. 
WITH UR - means instead of retrieving only committed work, your SELECT or FETCH will also retrieve rows that have not been committed by other tasks.

 

 

This sort of "Dirty reads" is not allowed in Oracle.

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 136 views
  • 0 likes
  • 2 in conversation