我正在使用r和mysql數據庫,並且我不知道如何在mysql中捕獲插入數據到表錯誤。在R中捕獲mysql錯誤
我有這樣的:
status <- tryCatch({ AnalyzerDb.insert_data_frame(dataset) })
但是當我運行的代碼我有一個錯誤:
Error en mysqlExecStatement(conn, statement, ...) :
RS-DBI driver: (could not run statement: Duplicate entry '00001002-2014-01-17 00:00:00' for key 'PRIMARY')
但當我查看狀態VAR值,變量具有NULL值。
感謝