필터 지우기
필터 지우기

Insert data from excel to a SQl database table

조회 수: 3 (최근 30일)
JFz
JFz 2016년 10월 20일
댓글: JFz 2016년 11월 1일
Hi,
I have many rows of data in an excel and I can read the excel data into a Matlab table. The table mirror a table in a SQl database table. How to import the entire Matlab table into the SQL table. I don't have database toolbox; but I have the connection conn.
Thanks in advance for all help.
Jennifer
  댓글 수: 1
JFz
JFz 2016년 10월 20일
I will append the excel data into an existing table and will have repeat every day.

댓글을 달려면 로그인하십시오.

채택된 답변

Keerthana Chivukula
Keerthana Chivukula 2016년 10월 31일
I would like to know if there is any reason why you want to use MATLAB to read data and write into database?
If there is any processing involved in MATLAB, you can use "readtable" function to read the data into MATLAB from EXCEL, process it in MATLAB and then use "writetable" function to write the data into any file format (CSV/ TXT/XLS etc). Once you have the processed data in a file, you can use Import Wizard in SQL Server Management Studio or any application such as JAVA which can read data from that file and insert into SQL database.
Refer to the link below to 'readtable' function: https://www.mathworks.com/help/matlab/ref/readtable.html
Refer to the link below to 'writetable' function: http://www.mathworks.com/help/matlab/ref/writetable.html
However, if you would like to you use MATLAB to communicate with Database directly, you will need to install Database Toolbox.
For more information about the Database Toolbox, refer to the link below: https://www.mathworks.com/help/database/index.html
  댓글 수: 1
JFz
JFz 2016년 11월 1일
Thank you. The reason I want to use Matlab to insert into SQL database is because I try to skip the import wizard.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by