matlab cannot find the datainsert function
Show older comments
I confirmed that I have Matlab's Database Toolbox. I also reinstalled the latest matlab R2017b because it didn't work with 2017a. It looks like Matlab might have a pretty serious bug, or maybe I'm doing something wrong. This is my first time trying. Here is what I do and the errors I get:
>> help datainsert
datainsert not found.
Use the Help browser search field to search the documentation, or type "help help" for help command options, such as help for methods.
That's already weird then I do:
>> conn=sqlite('test.db','create')
conn =
sqlite with properties:
Database: 'test.db'
IsOpen: 1
IsReadOnly: 0
>> exec(conn,'create table TestTable (IDtest NUMERIC, data_test NUMERIC)')
>> datainsert(conn,'TestTable','IDtest',1)
Undefined function or variable 'datainsert'.
Just so you can see that I have everything installed here is the output of my ver command:
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.3.0.713579 (R2017b)
MATLAB License Number: XXXXX
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 16299)
Java Version: Java 1.8.0_121-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.3 (R2017b)
Simulink Version 9.0 (R2017b)
Bioinformatics Toolbox Version 4.9 (R2017b)
Communications System Toolbox Version 6.5 (R2017b)
Computer Vision System Toolbox Version 8.0 (R2017b)
Control System Toolbox Version 10.3 (R2017b)
Curve Fitting Toolbox Version 3.5.6 (R2017b)
DSP System Toolbox Version 9.5 (R2017b)
Data Acquisition Toolbox Version 3.12 (R2017b)
Database Toolbox Version 8.0 (R2017b)
FYI datainsert is a built-in (not user-defined) function: https://www.mathworks.com/help/database/ug/datainsert.html
Accepted Answer
More Answers (1)
Arthur Goldsipe
on 18 Jan 2018
1 vote
Hi,
I think you need to use insert instead of datainsert. The Database Toolbox offers two different ways of working with sqlite databases. insert is the command to use when the connection is created using sqlite; datainsert is the command to use when the connection is created using database. You can read more about the two different approaches here .
1 Comment
James Johnson
on 18 Jan 2018
Edited: James Johnson
on 27 Jan 2018
Categories
Find more on Weather and Atmospheric Science in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!