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

Noted and thanks.
I have some mistake on database and code before but the problem already been fixed now.

1 Like

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?

forgot the blocks...

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...

Test this:

without doing anything else. Do you still get the error ?

(and reply here, do not create another new topic)

Sorry, thought this topic had been closed.

Not sure what you mean by "without doing anything elser"

If I don't use the ListFixer, I just see the "faulty" list of lists. As soon as I put the ListFixer in between I get the error.

Did I put the block in the right place?

Using companion app, just test these blocks


what do you get in your variable global dataToSend, an AI2 list of lists, or does it give an error ?

The result in the screenshot I send and mentioned earlier. I attach it again...

And that is with the ListFixer block ? The list format looks incorrect.

Can you select an item from that list ?

No this is without the list fixer block. With the block I get

Can you share your database, or a part of it, so I can test ?

(if your database is called something like mydata.db rename it mydata.db.txt to upload it here.)

A quick test shows everything seems to be working OK:

To debug, you will need to test each part of your blocks to see where your error arises...

Hi, The problem seems to be with the timestamp. Thanks for your help.

Perhaps you could explain, in order to help others? Where is the timestamp variable coming from ?

Hi TIMAI, I whish I could explain and I will when I get further, but I have been trying to solve the issue with the timestamp which I also need to get from sqlite. I can get the value, it is stored correctly in the db e.g. 17160554635472. But then when I retrieve the value and show it in a label, it is a negative value like -1930814470. I added the blocks and an example...

Please show your full query

This is the full query. As said it return values at the expected moment, and they seem to change gradually like you would expect from timestamps, just it is not the right number...

SELECT MAX(time) AS biggest_timestamp FROM lastTimestamp;

Not really sure I understand how that query is supposed to work ?

What is lastTimestamp ? not a table in your db...

Where is the column time ? (edit, I found this in the user table)

Your timestamp field in table stickdata is a text

I do not get any data back from running that query against your database.

What results are you hoping to return, and from where?

Hi. Forgot to mention that. I created the table lastTimestamp with the column time. My code has a clock that fires every 6 seconds, setting a new last timestamp in the time column. The timestamp is written to it as it should. It is when retrieving that it gets changed. I removed the alias so now the query is
SELECT MAX(time) FROM lastTimestamp;
but the result is the same.
mydb.db.txt (2.9 MB)