Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2010
    Posts
    40

    Unanswered: JVMs reading different data.

    Hello All,
    Is there anythign equivalent to SQL Server clauses READPAST and UPDTLOCK in DB2?

    Actually what I need is:
    THere are two JVMs and both fires the same query at the same time and the same database but the records that first JVM fetches should be different from the second one. Means,if first JVM fetches rows 1,2,3,4 and 5 from a table with 10 rows,second JVM should bring me the other 5 rows.

    There should be minimal delay. Please suggest if you have an alternative.

    Thanks in Advance.

  2. #2
    Join Date
    Aug 2010
    Posts
    40
    found the solution,posting it here to help others:

    Use the following clause at the end of select statement:
    SKIP LOCKED DATA.

    SELECT COUNT (*)
    FROM TABLE
    WHERE FNAME >= ’AAA’
    SKIP LOCKED DATA;

    This works for DB2 ZOS no idea about LUW.

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    If you want to include locked data without waiting for locks to release:

    SELECT COUNT (*)
    FROM TABLE
    WHERE FNAME >= ’AAA’
    WITH UR;
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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