Database Toolbox is installed but MATLAB can't locate most SQL-related commands?

5 views (last 30 days)
I installed Database Toolbox (v10.2) on MATLAB 2021b a few days ago, and can run the sqlite command, but that's about all—most of the SQLite commands listed on this page don't work. They trigger errors, e.g. "Unrecognized function or variable 'sqlwrite'." As you can see in the attached screenshot, MATLAB can't locate most of the commands (and can find execute, but I believe it's a different function than the one that's supposed to be used with databases).
Does anyone have any tips on how to troubleshoot this issue? I couldn't find any other questions about this, so I'm wondering if there was something else I was meant to install along with the Database Toolbox to get access to the full range of commands?

Answers (1)

Abhijeet
Abhijeet on 6 Sep 2023
Hi Sofie,
I understand that you are getting "Unrecognized function or variable 'sqlwrite' error while using ‘sqlwrite’ function. 'sqlwrite' is a method of the 'connection' object and can only be called on an instance of 'connection' object.
Since the function exists within the class, MATLAB does not know of its existence without having access to an instance of the class and therefore throws the error you are seeing. Please ensure that you are creating a connection and passing it to the 'sqlwrite' function using ‘connection’ object.
Please follow the steps below to set up and connect to an SQL server:
I hope this information was helpful!

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!