Closed eroten closed 11 months ago
Thanks for the report.
Can you also send along the table / column definitions?
You may be able to use odbcConnectionColumns
.
tibble::tribble(
~name, ~field.type, ~table_name, ~schema_name, ~catalog_name, ~data_type, ~column_size, ~buffer_length, ~decimal_digits, ~numeric_precision_radix,
"PARK_UNIT_SK", "int identity", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", 4L, 10, 4, 0L, 10L,
"PARK_UNIT_ID", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 3, 6, 0L, 0L,
"PARK_UNIT_ID_CURRENT", "ntext", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -10L, 1073741823, 2147483646, 0L, 0L,
"PARK_UNIT_NAME", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 200, 400, 0L, 0L,
"PARK_UNIT_HISTORICAL_NAME", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 200, 400, 0L, 0L,
"PARK_TYPE", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 2, 4, 0L, 0L,
"IMPL_AGENCY_ID", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 2, 4, 0L, 0L,
"IMPL_AGENCY_FINANCE_ID", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 2, 4, 0L, 0L,
"COUNTY_ID", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 3, 6, 0L, 0L,
"RECORD_STATUS", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 1, 2, 0L, 0L,
"UPDATE_DATE", "datetime2", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 27, 54, 0L, 0L,
"UPDATE_BY", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 30, 60, 0L, 0L,
"REASON_FOR_CHANGE", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 4000, 8000, 0L, 0L,
"PARK_UNIT_STATUS", "nvarchar", "PARK_UNIT", "xxx", "CD_RESEARCH_WEB", -9L, 4, 8, 0L, 0L
)
Hi - had a chance to look into this.
It's again an issue with the CRAN version of the package and we've opened an issue with the maintainer there. In the meantime, I was able to build locally from source with:
install.packages("odbc", type="source")
Thus installed, did not see any issues with characters being swallowed.
You said this did not work for you - can you provide a bit more detail?
Thanks again for the report.
When I use odbc after building from source, it crashes RStudio when I rundbConnect()
. I don't have issues with RStudio crashing when I install odbc normally.
Same.
Hello - can you try again after reinstalling the CRAN binary/package?
The CRAN binary was rebuilt in a way, I believe, that should fix this issue.
Thanks
Checked with the rebuilt CRAN package / confirmed issue fixed.
I can also confirm, uninstalling and re-installing the odbc
package solves the issue. Thanks a lot for fixing this!
agreed with above.
Issue Description and Expected Result
In R version 4.3.1, odbc version 1.3.5, columns of type character are only reading in every other character (dropping even-indexed characters). This is the same behavior as noted previously in #283
Database
Microsoft SQL Server Version: 13.00.6419
Examples
Pay attention to the
PARK_UNIT_NAME
column.Reprex 1 (R 4.3.1)
Created on 2023-10-04 with reprex v2.0.2
Reprex 2 (R 4.2.3)
Created on 2023-10-04 with reprex v2.0.2
Workarounds tried
Thanks to @RaSieb for finding the 4.2.3 workaround https://github.com/r-dbi/odbc/issues/283#issuecomment-1732967651