yes looks like a typo in cn1. I think that inside the delete function of
the SQLMap class `if(count == 0)` (line 501) should be `if(count != 0)`
which is the reason why the DELETE statement is malformed.
Until it is fixed by the CN1 team, you should try to create a simple SQL
statement yourself to clean your table (TRUNCATE TABLE SignInListDetail should
probably work and you could try TRUNCATE TABLE ? or DELETE FROM ? if you
want to clean every table in you database) which should be more efficient
anyway
On Wednesday, April 25, 2018 at 2:32:36 AM UTC+2, Paul Wade wrote:
>
> I'm using Intellij IDEA. Running the following code results in an SQL
> syntax error.
>
> The code:
>
> private void clearAllEntries(Database db, SQLMap sqlMap) throws
> IOException, InstantiationException {
> SignInListEntry signInListEntry = new SignInListEntry();
> List<PropertyBusinessObject> objs = sqlMap.select(signInListEntry,
> signInListEntry.signInListId, true, 1000, 0);
> Logger.log("Deleting " + objs.size() + " entries");
> for (PropertyBusinessObject o : objs) {
> sqlMap.delete(o);
> }
>
>
>
> The log message showing the DELETE statement:
>
> DELETE FROM SignInListDetail WHERE ,entryId = ?signInListId = ?firstName
> = ?lastName = ?email = ?officePhone = ?mobilePhone = ?organization =
> ?address1
> = ?address2 = ?address3 = ?city = ?state = ?country = ?zip = ?
>
> And the error:
>
> java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (near
> ",": syntax error)
>
> It's not a missing database because I can add records to the same database
> using the same Database object and SQLMap. Am I doing something wrong or
> is this a CN1 bug?
>
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/46eee647-24dd-4030-94e7-6b3c9611bde9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.