Matlab database toolbox writting error

Error using database.odbc.connection/sqlwrite (line 218) ODBC JDBC/ODBC Error: ODBC Driver Error: .

6 件のコメント

Guillaume
Guillaume 2018 年 5 月 15 日
You have not provided any context or code with your error. All we can tell you is that your ODBC driver is not happy for some reason. We're not clairvoyant so can't tell you why it's not happy without more information.
Alex Fernandez
Alex Fernandez 2018 年 5 月 15 日
Sorry. I use Matlab2018 and MySQL ODBC driver v.8.0. I make succesfully the connection with conn function. Besides, I can read my data using sqlread function; no problem. But when I try to write my data, it prompts the error message
Greg
Greg 2018 年 5 月 16 日
Is your database or file system set to read-only?
Guillaume
Guillaume 2018 年 5 月 16 日
But when I try to write my data, it prompts the error message
Possibly, there's something wrong with the syntax of your write instruction. Possibly, as greg says, your database is read only. Possibly, you're trying to write in a non-existant table or column, ...
Again, without seeing what you're actually doing, there's no way we can tell.
Alex Fernandez
Alex Fernandez 2018 年 5 月 27 日
編集済み: Alex Fernandez 2018 年 5 月 27 日
%%Connection to database
>> conn = database(tablename,username,password);
>> conn.Message % ans = [] if successful connection
%%Read data
>> setdbprefs('DataReturnFormat','table');
>> data_estacion = sqlread(conn,table1);
>> data_trh = sqlread(conn,table2);
%%Writing data
>> data_result = table(data_1,data_2,data_3,'VariableNames'{'Name_1','Name_2','Name_3'});
>> sqlwrite(conn,table_result,data_result)
Alex Fernandez
Alex Fernandez 2018 年 5 月 27 日
編集済み: Alex Fernandez 2018 年 5 月 27 日
I work with PHPMyAdmin database and ODBC Driver 8.0. The program stops before sqlwrite function. I don't know what to do. I would appreciate any kind of help. Thanks.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeReporting and Database Access についてさらに検索

質問済み:

2018 年 5 月 15 日

編集済み:

2018 年 5 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by