🟥 [FREE] SimpleSqlite - an extension for working with SQLite Databases

In case you are talking about my extension at App Inventor Extensions: SQlite | Pura Vida Apps
In case of an error, the error will be returned directly in the Execute method or for the ExecuteAsync method in the Executed event


1 Like

Oh ok, that probably was the one I was referring to. The description I was looking at seemed to be indicating that it would only return an error message if import or export fails.

sqlite list. Where am I going wrong?

You have a list of lists:

What is this ListFixer method about?
You probably get your result after removing that method. .
Alternatively use a sqlite extension, which really is simple to use.. App Inventor Extensions: SQlite | Pura Vida Apps

See the documentation.

yes, list list.

Can you see the difference?

It's like peeling an onion, working from outside in one layer at a time.

The expressions are evaluated from right to left, so the rightmost selection gets you the outermost layer, then proceed from right to left.

1 Like

I got it, thanks!


Here is a fairly clean solution to the issue of checking whether an attempt to insert or update a record complies with databse uniqueness requirements, and therefore would fail if the insert was attempted. This is an alternative to attempting the insert or update and then checking to see if it failed or not, so these tests are added to the list of other field or row validation tests: Using 'EXISTS' to check for whether any other records match the selected field. For completeness, the SQL commands are like this:

SELECT EXISTS (SELECT 1 FROM context WHERE context_short = '

the 'SELECT 1' subquery only needs to select one row to demonstrate that a record already exists with the same field value, although there shouldn't really be any more than one record already existing anyway in this particular instance because we're testing for uniqueness. I hope this helps anyone else who has faced the same issue as me.

Just to point out, in this instance I'm only using visible labels as variables so I can see what the output is during development. A normal non-visible variable should work just as well.

Hi, after I created my mobile application, it seems that my database is not receiving the data we input to the database.

Here is a sample blocks that I used:

Can you help me fix my problem?

Your blocks show that you are hard coding your database location to the companion app files (probably assets ?)

You cannot write to a file in assets.

IMPORT your databse from the assets to your default (empty?) database. If you have data in your default database, then you should EXPORT the db first.

1 Like

What I have is a schema for the database, so technically there is no data in the database, can you further explain what I need to do in order to establish the my database in the mobile app?

sorry, im new in using MIT app and connecting my application to the database appears to be hard for me.

Please read the documentation linked to in the first post.

The extension will only load (open/import) a valid sqlite database file. You would need to open an empty database (an example of one is provided in this topic), then you should be able to apply a schema (not tried this).

However, I have read:

there is no notion of schema in SQLITE, at least not in the same way as in MSSQL

I just want to know about simplesqlite extension support.

I found the sql select command that use more than 1 table and using INNER JOIN to connect a table to another table could not be run with expected result.

The SQL command as follow :
SELECT postalcode.postal_code, subdistricts.subdis_name, districts.dis_name, cities.city_name, provinces.prov_name FROM postalcode INNER JOIN subdistricts ON postalcode.subdis_id = subdistricts.subdis_id AND postalcode.dis_id = subdistricts.dis_id INNER JOIN districts ON postalcode.dis_id = districts.dis_id AND postalcode.city_id = districts.city_id INNER JOIN cities ON postalcode.city_id = cities.city_id AND postalcode.prov_id = cities.prov_id INNER JOIN provinces ON postalcode.prov_id = provinces.prov_id WHERE postalcode.postal_code LIKE '13470%'

This SQL command could be well proceed on 'SQL Browser" as follow :

But it cannot be proceed as expected by app inventor using simplesqlite extension which when I run the app I got query result: ["SQL command completed"] as follow:

The code block in app inventor as follow :

Is this caused simplesqlite extension does not support that complex SQL command ?

Please advice.

run DO IT on globsl sql, and copy the result here.
make sure you have join the sentence correctly, especially the spaces before and after each word.

I saw there are some mistake on my tables.
I will back and respond you after everything fixed both database and code.

The extension is simply a vehicle for SQLite commands, passing a command directly to sqlite.