Hi Markus, I ran your code on my own SQLite database and got the same error as you did and noticed something curious that is not entirely clear on the SQLite or exec documentation pages. In the Exec documentation page
https://www-integ3.mathworks.com/help/releases/R2018a/database/ug/exec.html?searchHighlight=exec&s_tid=doc_srchtitle
it says the following
“exec(conn,sqlquery) performs database operations on a SQLite database file by executing the SQL statement sqlquery for the SQLite connection conn using the MATLAB® interface to SQLite.”
However it does not mention SQLite in the examples below where it sets the result of exec to the variable curs. I set up another connection to a database and it looks like the SQLite connection is a different type of object than a normal database connection object in MATLAB. It doesn’t look like it is possible to set the value of exec to be a cursor object for a SQLite connection made using the sqlite function, however you should be able to get a proper connection object if you instead establish the connection with the JDBC driver and database function.
https://www.mathworks.com/help/database/ug/sqlite-jdbc-windows.html#bt8kopk-3
You can interface with it from the command line as they show at the bottom of the doc page and this object should let you assign the result of exec to be a cursor object.
Best Answer