with statement error when targeting android

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
RobInDayton
Posts: 5
Joined: Mon 14 Jul 2014 23:50

with statement error when targeting android

Post by RobInDayton » Wed 16 Jul 2014 19:59

The following sql statement works fine when the target is Win32, but when I target Android I get:exception class ESQLiteError with message 'near "WITH": syntax error'.

sql.Add('WITH RECURSIVE EntityTree("EntityID", "Type", "ParentID") AS( ');
sql.Add(' SELECT "EntityID", "Type", "ParentID" ' );
sql.Add(' FROM "tblEntity" ');
sql.Add(' WHERE "EntityID" = ' + IntToStr(CurEntity.EntityID) + ' ' );
sql.Add('UNION ');
sql.Add(' SELECT e."EntityID", e."Type", e."ParentID" ');
sql.Add(' FROM "tblEntity" e ');
sql.Add(' JOIN EntityTree et ON (et."EntityID" = e."ParentID")');
sql.Add(') ');
sql.Add('SELECT Count("EntityID") As CountOfUnits FROM EntityTree ');
sql.Add('WHERE "Type" in (4, 5, 7, 10, 13, 16, 19, 21, 23) ');

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: with statement error when targeting android

Post by AlexP » Fri 18 Jul 2014 10:35

Hello,

This functionality was added in the SQLite version 3.8.3: http://www.sqlite.org/releaselog/3_8_3.html . Your Android device has probably an older SQLite library.

Post Reply