I am trying to set a field by SQL to find a gap in groupid's from the Group_x table. Im running what i believe is ANSI SQL but allways get the error
ARERR [552] Failure during SQL operation to the database : ORA-00911: invalid character
Im running the following SQL:
SELECT MIN(Group_id) + 1 FROM Group_x a WHERE NOT EXISTS ( SELECT NULL FROM Group_x b WHERE b.Group_id = a.Group_id + 1) and a.Group_id between 8000 and 8108;
Running in sql+ are no problem and logging whats run gives the exactly same syntax as above. Is it the "EXISTS-Clause"? Can someone please point out what im doing wrong and if possible provide a better sql for finding a gap within a sequense of Groupid's.