odbc
odbc copied to clipboard
dbAppendTable doesn't return errors
I'm inserting duplicated rows in a SQL Server table.
If I use dbAppendTable, I'm getting a meaningless "[0]" as result.
If I use dbWriteTable with append = TRUE, I'm getting the error that happened behind the scene:
Error in result_insert_dataframe(rs@ptr, values) : nanodbc/nanodbc.cpp:1587: 23000: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Violation of PRIMARY KEY constraint 'PK__xxxxx'. Cannot insert duplicate key in object 'xxxxxxxxxx'. The duplicate key value is (xxxxxxxx).
It'd be useful also dbAppendTable will return errors.