8 Replies Latest reply on Mar 17, 2011 3:42 PM by chrismarx

    arithmetic subtraction fails in 10g, works in 11g

    chrismarx
      With this setup:

      create table person (id number, version number, groupscount number);

      create table groupfollower (followerid number, followingid number);

      insert into person values (1,1,0);
      insert into person values (2,1,0);
      insert into groupfollower values (1,2);


      UPDATE Person
      SET version =version+1,
      groupsCount=
      *(SELECT COUNT(followingg1_.followerId)*
      FROM GroupFollower followingg1_
      WHERE Person.id=followingg1_.followerId
      *)-1*
      WHERE id IN
      (SELECT groupfollo2_.followerId
      FROM GroupFollower groupfollo2_
      WHERE groupfollo2_.followingId=2
      )

      10g produces an error -- ora-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly ended" Cause: Action: Error at Line:16 Column:4 Line 16 is the ")-1"

      should this not be valid? The query actually works just fine you put the 1- in front, but these queries are being generated by hibernate, and I'm not sure how to override this behavior-