Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2014
    Posts
    1

    Unanswered: Using WITH UR against View

    I've seen this discussion several times but haven't seen it asked like this:

    I have the following SQL stored as a db2 view "myView":
    Code:
    SELECT ABAN8,ABALPH,WWMLNM,ABAT1,A5BADT,ABAC04,ABAC05,ABAC06,ABSIC,ALADD1,ALADD2,ALCTY1,ALADDS,ALADDZ,ALCOUN,
    (SELECT WPAR1 FROM F0115 WHERE ABAN8 = WPAN8 AND WPRCK7 = 1 AND WPIDLN = 0) AS PHONE
    FROM F0101
    LEFT JOIN F0116 ON ABAN8 = ALAN8 AND ABEFTB = ALEFTB
    LEFT JOIN F0301 ON ABAN8 = A5AN8
    LEFT JOIN F0111 ON ABAN8 = WWAN8 AND WWIDLN = 0
    WHERE ABAT1 IN('C','S','XC','XS') AND ABAC04 IN('H','V') AND ABAC05 NOT IN('PAS','PAT','GEN')
    If I were to query the view with:
    Code:
    SELECT * FROM myView WITH UR
    ... would this specify the WITH UR parameters for the underlying selects in the view and consequently prevent any locking on the affected tables?

    Thanks in advance for any help!

  2. #2
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    Yes, but WITH UR does take locks, just minimal locks
    Dave

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •