yes, list list.
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.
I got it, thanks!
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.
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.
Thanks,
Asri
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.
Thanks.
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.
Noted and thanks.
I have some mistake on database and code before but the problem already been fixed now.
Hi, I extract data from sqlite with simple sqlite. I seem to get a list of lists. I can use the for each blocks (numbers or items) and they return what looks like a list, but when I check if it is a list with the "is a list? thing" block it says it ist't and it also does not allow any list operations. It is also not a string. How can I access the data?
I add screenshots from the blocks and the errors. The Bad arguments is what I get when trying a list operation on the item returned by the for each loop. The index is too large I get when trying to access the first element of the list I get as result from the sql query. The third screenshot shows the vallue returned by the sql query.
Anny Idea how to get to the values from the sqlite db?
Use the fixer block to repair the output list from sqlite, this is explained in the documentation.
Hi, I am not sure I am using the sqlite list fixer right. I get length=0, index=0 error.
Hope this wasn't explained somewhere, I couldn't find a usage example...