Spring Batch
  1. Spring Batch
  2. BATCH-1497

SqlServerPagingQueryProvider should use an alias for the inner query in a jump-to-item query

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.4, 2.1.0.RC1
    • Fix Version/s: 2.0.Maintenance, 2.1.0
    • Component/s: Infrastructure
    • Labels:
      None

      Activity

      Hide
      Dave Syer added a comment -

      Duplicates BATCH-1499

      Show
      Dave Syer added a comment - Duplicates BATCH-1499
      Hide
      Shridhar Swaminathan added a comment -

      For MS-SQL server, the correct query for

      SELECT
      SORT_KEY
      FROM
      ( SELECT
      E.JOB_EXECUTION_ID AS SORT_KEY,
      ROW_NUMBER() OVER (ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER
      FROM BATCH_JOB_EXECUTION E, BATCH_JOB_INSTANCE I
      WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID)
      WHERE ROW_NUMBER = 20

      with the alias is

      SELECT
      SORT_KEY
      FROM
      ( SELECT
      E.JOB_EXECUTION_ID AS SORT_KEY,
      ROW_NUMBER() OVER (ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER
      FROM BATCH_JOB_EXECUTION E, BATCH_JOB_INSTANCE I
      WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) A
      WHERE ROW_NUMBER = 20

      Show
      Shridhar Swaminathan added a comment - For MS-SQL server, the correct query for SELECT SORT_KEY FROM ( SELECT E.JOB_EXECUTION_ID AS SORT_KEY, ROW_NUMBER() OVER (ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM BATCH_JOB_EXECUTION E, BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) WHERE ROW_NUMBER = 20 with the alias is SELECT SORT_KEY FROM ( SELECT E.JOB_EXECUTION_ID AS SORT_KEY, ROW_NUMBER() OVER (ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM BATCH_JOB_EXECUTION E, BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) A WHERE ROW_NUMBER = 20

        People

        • Assignee:
          Dave Syer
          Reporter:
          Dave Syer
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Time Tracking

            Estimated:
            Original Estimate - 20m
            20m
            Remaining:
            Remaining Estimate - 20m
            20m
            Logged:
            Time Spent - Not Specified
            Not Specified