フィルターのクリア

How to suppress "Warning: ATTR will be removed in a future release" when update( ) MySQL?

4 ビュー (過去 30 日間)
Simon
Simon 2023 年 1 月 9 日
移動済み: Steven Lord 2023 年 1 月 11 日
Everytime I use the update( ) function to update a row in a MySQL table, the warning message is displayed
Warning: ATTR will be removed in a future release
My program was updating thousands of rows in a MySQL table, and the warning is displayed thousands of times. As a result, I couldn't see other warning messages or my own prompt message.
What should I do to suppress that warning specifically? Or should I replace update( ) with another function?

採用された回答

Luca Ferro
Luca Ferro 2023 年 1 月 9 日
移動済み: Steven Lord 2023 年 1 月 11 日
to suppress a specific warning you need to find it's identifier using:
w=warning('query','last'); %store last warning as a 2 field struct (identifier,status)
wid=w.identifier; %store identifier
and then turn it off with:
warning('off',wid); %set warning to off
in a similar fashion you can turn it on again if needed.
For the warning itself i wouldn't worry too much, still you could try to run an update query from matlab instead of using the update function.:
SQLdbconn=database('SQLDatabaseName','username','password'); %make connection to database
query= ['UPDATE table_name SET column1=value WHERE condition']; %create query as string
data=fetch(SQLdbconn,query) %execute update query and fetch results
  3 件のコメント
Luca Ferro
Luca Ferro 2023 年 1 月 11 日
移動済み: Steven Lord 2023 年 1 月 11 日
Glad it helped, could you accept my comment as an answer? i've mistakenly written it in the comment section
Simon
Simon 2023 年 1 月 11 日
移動済み: Steven Lord 2023 年 1 月 11 日
I actually was wanting to do the 'accept', but I couldn't find the button to click.
Could you repost your answer as 'Answer this question?' Thanks.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by