matlab cannot find the datainsert function
이전 댓글 표시
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
채택된 답변
추가 답변 (1개)
Arthur Goldsipe
2018년 1월 18일
1 개 추천
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
James Johnson
2018년 1월 18일
편집: James Johnson
2018년 1월 27일
카테고리
도움말 센터 및 File Exchange에서 Weather and Atmospheric Science에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!