updating an sql lite database on my macbook delete and insert

1 回表示 (過去 30 日間)
Charles
Charles 2017 年 8 月 28 日
コメント済み: Charles 2017 年 8 月 31 日
Hi I wish to update an SQL Lite database file in Matlab on my macbook I understand sql lite has limitations. The replace function does not work. It seems I can merely insert.
The sql lite database already exists. My workflow is
1. retrieve new data for previous 2 period and latest period into Matlab from external data source as a cell array. Thus I will have three rows of data
2. Delete last three rows of data in designated table.
3. insert new data (3 rows) into designated table.
Is there a replace function I can use, or can I really only use insert
my syntax for insert looks like so, where VolumeTable is the designated table, and New_datavoldt is the new data I wish to insert
insert(conn, 'VolumeTable', {'Dates','AUD_CAD', 'AUD_CHF','AUD_HKD','AUD_JPY'}, New_datavoldt(2:end,:))
How do I delete the last three rows before Insert, and is this the best way to achieve mt objective using an SQL Lite file/database

回答 (1 件)

Abhisek Roy
Abhisek Roy 2017 年 8 月 31 日
The MATLAB interface to SQLite supports the insert function only. https://www.mathworks.com/help/database/ug/inserting-data-using-command-line.html
Please refer the following document that describes about how to insert data from MATLAB into the SQLite database- https://www.mathworks.com/help/database/ug/insert.html
  2 件のコメント
Charles
Charles 2017 年 8 月 31 日
Hello. Thanks for this. Most kind
Charles
Charles 2017 年 8 月 31 日
Are there other options as I need full functionality

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by