Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-171

Need Correlation ID in UPDATE/DELETE statements

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.1.2.1
    • 10.2.1.6
    • SQL
    • None
    • Windows XP SP1 Professional

    Description

      You currently can't use a correlation ID in an UPDATE/DELETE statement. This makes it cumbersome to do the following:

      UPDATE EMPLOYEE_BONUS
      SET BONUS = (SELECT SUM(BONUSES.BONUS) FROM BONUSES WHERE
      EMPLOYEE_BONUS.EMPL_ID = BONUSES.EMPL_ID);

      The use of a correlation ID makes this easier to code.

      UPDATE EMPLOYEE E
      SET BONUS = (SELECT SUM(B.BONUS) FROM BONUSES B WHERE B.EMPL_ID = E.EMPL_ID);

      This is particularly important if you get carried away with long SCHEMA and TABLE names!

      Attachments

        1. bug171.diff
          75 kB
          Richard N. Hillegas
        2. bug171.html
          0.9 kB
          Richard N. Hillegas

        Issue Links

          Activity

            People

              rhillegas Richard N. Hillegas
              baklarz George Baklarz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: