PedrozaSQLite1 Insert error

My SQLite table definition follows. The .sqlite database is imported using the TaifunSqlite.Import block - successfuly as the TaifunSqlite.ExecuteSql block displays 2 ct_Capture rows in my ListBox.

The pedrozaSQLite1.GetPath block produces:-
/data/data/com.thunkable.appinventor.aicompanion3/databases/DATABASE.sqlite

CREATE TABLE “ct_Capture” (
“capID” INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
“capTaskID” INTEGER NOT NULL,
“capTime” TEXT NOT NULL,
“capDescription” TEXT,
“capIndex” INTEGER NOT NULL )

screenshot thunkable community #1screenshot thunkable community #2

In every Thunkable Live test, ShowAlert always produces -1 : a PedrozaSQLite1.Insert error!

Any help greatly appreciated.
C.

why don’t you use the TaifunSqlite extension to INSERT something into the table then?
there really is no need to use both extensions in parallel…
Taifun

1 Like

Great! Thank you for your reply. First off, there is no need for a column with autoincrement in SQLite, here is why: https://sqlite.org/autoinc.html

And second, the table is created in captureTime.sqlite and my extension only uses tables created in DATABASE.sqlite.

If you are using Taifun’s extension to import the database, you can use the extension to do the queries. If you don’t know how to write the queries you can use Andrés Cotes extension to help you (available at AppInventor Forum) or you can learn about Sql sentences in SoloLearn.org (highly recommended) or tutorialspoint.com

1 Like

Hi Carlos,
Thanks for this. I tried creating a table, before using the import solution, but got -1 errors then as well!? I will try again as I may have been trying with autoincrement - thanks for RowId tip.
I still don’t understand why your extension, with very useful blocks, won’t work on my imported captureTime tables? Is there a way your extension can work with imported tables?
If not, I will try the sql statement route.

Thanks again,
ChrisA.