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

Small typos in devguide examples

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 10.10.1.1
    • 10.10.2.0, 10.11.1.1
    • Documentation
    • None

    Description

      I came across two examples with small typos in the developer's guide.

      http://db.apache.org/derby/docs/10.10/devguide/cdevspecial41728.html:

      try {
      preparedStatement.execute();
      } catch (SQLException se ) {
      String SQLState = se.getSQLState();
      if ( SQLState.equals( "23505" ) )

      { correctDuplicateKey(); }

      else if ( SQLState.equals( "22003" ) )

      { correctArithmeticOverflow(); }

      else

      { throw se; }

      }

      Here, the first line in the catch block is not at the same indentation level as the other statements in the block.

      http://db.apache.org/derby/docs/10.10/devguide/cdevspecial53165.html:

      CREATE TRIGGER . . .
      DELETE FROM flightavailability
      WHERE flight_id IN (SELECT flight_id FROM flightavailability
      WHERE YEAR(flight_date) < 2005)

      This example has an unmatched closing parenthesis. And even if it were matched, it should have come before the semicolon.

      (By the way, should the semicolon be kept or removed? Derby's SQL dialect doesn't accept statements that end with a semicolon, but ij does.)

      Attachments

        1. DERBY-6316.diff
          2 kB
          Camilla Haase
        2. DERBY-6316.stat
          0.1 kB
          Camilla Haase
        3. DERBY-6316.zip
          5 kB
          Camilla Haase

        Activity

          People

            chaase3 Camilla Haase
            knutanders Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: