1

I have an odbc connection setup in R where I am reading a table with multiple column from SQL database and writing in R dataframe. I get an error when trying to read and write a jsonb data column. The process works if I read and write all the other columns that are in varchar and float data type.

This is the error I receive - "Error in result_fetch(res@ptr, n) : wstring_convert::to_bytes"

Any input on how can I write the jsonb data column. thanks,

Phil
  • 7,287
  • 3
  • 36
  • 66
Neel
  • 31
  • 6
  • May we have a [mre], please? – Kitswas Jun 15 '22 at 17:51
  • From [this answer](https://stackoverflow.com/a/22910602/8659747), jsonb is stored as binary. The error message tells you that some string conversion fails. Try using json instead of jsonb and see what happens. – Kitswas Jun 15 '22 at 18:00
  • Nice thanks. json worked. I am still not sure where is issue is but json serves the same purpose. – Neel Jun 16 '22 at 01:12

0 Answers0