Topic Options
Rate This Topic
#141613 - 09/10/10 05:21 AM Set field SQL
Gurra Offline
Just Signed Up

Registered: 02/21/05
Posts: 2
Greetings!

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.

ARS 7.1 p7
Oracle 10g
Windows Server 2003

Sincerly
Gurra

Top
#141614 - 09/10/10 11:34 AM Re: Set field SQL [Re: Gurra]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Hi,

In the set fields, you have to remove the ; at the end of your SQL statement.
_________________________
Vincent.

Top
#141615 - 09/10/10 01:30 PM Re: Set field SQL [Re: Vincent_RIEDWEG]
Gurra Offline
Just Signed Up

Registered: 02/21/05
Posts: 2
Oh... i must have been tired smirk Copy-pasted the full syntax all the time but when reducing the statements and testing (and it worked) i wrote by hand.

Thanks for the answer ofc its that.

Top