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

Dynamic parameter should be allowed to be the operand of unary operator "-". Derby throws exception 42X36: The '-' operator is not allowed to take a ? parameter as an operand."

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.2.1.6
    • 10.2.1.6
    • JDBC
    • None

    Description

      A simple test program which uses dynamic parameter for unary operator "-" fails with an exception. Following is the snippet of the code
      ps = con.prepareStatement("select * from t1 where c11 = -?");
      ps.setInt(1,1);
      rs = ps.executeQuery();
      The prepareStatement call fails with following exception
      SQLSTATE(42X36):ERROR 42X36: The '-' operator is not allowed to take a ? parameter as an operand.

      Attachments

        1. Derby582UnaryDynamic092605.txt
          5 kB
          Mamta A. Satoor
        2. Derby582UnaryMinusDynamic104005.txt
          30 kB
          Mamta A. Satoor
        3. Derby582UnaryParameter101105.txt
          91 kB
          Mamta A. Satoor

        Activity

          People

            mamtas Mamta A. Satoor
            mamtas Mamta A. Satoor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: