문제

If I read out a field of type "datetime" it returns a character vector. Is it the genral way or do I have to notice something? This post came up with a similar question.

도움이 되었습니까?

해결책

In the DBI vignette (vignette("DBI")), Chapter 4 ("Data Type Mappings"), it states

By default dates and date-time objects are mapped to character using the appropriate TO_CHAR function in the DBMS (which should take care of any locale information).

I can't find any suggestion that RJDBC overrides this behaviour, so you'll have to manually convert your dates. Take a look at strptime, or the wrappers in the lubridate package.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top