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

4 次查看(过去 30 天)
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?

回答(1 个)

Abhijeet
Abhijeet 2023-9-6
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!

类别

Help CenterFile Exchange 中查找有关 Database Toolbox 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by