8

We are moving away from RODBC which seems to have a limited error handling system (sometimes to query goes through even though there was an error, and there is no way to get the error message. we have tried all RODBC functions)

However there seem to be 2 packages similar: odbc and DBI, Can someone explain what is the difference between the two? Both seem to work well.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
RockScience
  • 17,932
  • 26
  • 89
  • 125
  • 1
    Check this out: http://blog.revolutionanalytics.com/2017/08/a-modern-database-interface-for-r.html – tomaz Jan 30 '18 at 09:16
  • 1
    @tomaz thanks for the link that provides a nice background, however it does not explain why one would need to use `odbc` when underlying package `DBI` seems to do same (with same function names) – RockScience Jan 30 '18 at 09:29
  • 1
    I think `odbc` will translate dplyr code to SQL and run it on the database and `DBI` won't. – tomaz Jan 30 '18 at 09:51
  • ok thanks that would makes sense. – RockScience Jan 30 '18 at 09:53
  • What I don't really understand is if they are trying to make their commands compatible. It's totally confusing, at least that's my impression. – hannes101 Jul 02 '20 at 09:19

1 Answers1

1

look at the odbc github https://github.com/r-dbi/odbc#reading

They compare with the RSQLServer package and the odbc package seems to be faster.

Alexandre Lima
  • 135
  • 1
  • 2
  • 3
    A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](https://meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. Answers that are little more than a link may be deleted. – R Balasubramanian Aug 01 '18 at 17:41