on 2013 Dec 05 6:56 AM
I am using ultralitej database on android application and i need to delete rows with negative ID that exists in the same table with positive ID and same Code column. This sql executes without error in MSSql server but raises an error here: Syntax error near FROM at offset 10
DELETE r FROM Remote as r, Remote as r1 WHERE r.ID < 0 AND r.Code = r1.Code AND r1.ID > 0
Is there anything specific about delete with join in ultrealitej ? I tried with a subquery but got another error: Row has changed since last read -- operation canceled
DELETE FROM Remote WHERE ID < 0 AND EXISTS (SELECT * FROM Remote rReal WHERE rReal.ID > 0 AND rReal.Code = Remote.Code)
The subquery worked.. i cannot explain why that error appeard, but now is working
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can't tell why the EXISTS subquery does not work as expected, however, the "DELETE with a table-list syntax" seems unsupported by UltraLite.
That's easily noticable if you compare the DELETE syntax for SQL Anywhere (confine synax 2 which does allow a table-list, just like MS SQL) and for UltraLite.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.