商用DBにアクセスしています。プロンプト経由:
select PersonCode, PersonDate from CODB.mastertable where PersonCode=42
PersonCode PersonDate
----------- ------------
42 Jan 3 2011
42 Jan 3 2011
42 Jan 3 2011
42 Jan 3 2011
42 Jan 3 2011
42 Jan 3 2011
42 Jan 3 2011
42 Jan 3 2011
42 Jan 3 2011
42 Jan 3 2011
Rで:
library(RODBC)
query <- "select PersonCode, PersonDate from CODB.mastertable where PersonCode=42"
connection1 <- odbcConnect("RESDB", uid="userID", pwd="pwdaccess", believeNRows=FALSE)
sqlQuery(connection1,query)
sqlQuery(connection1,query)
PersonCode PersonDate
1 42 01/03/2011 00:00:00.000 UTC
2 42 01/03/2011 00:00:00.000 UTC
3 42 01/03/2011 00:00:00.000 UTC
4 42 01/03/2011 00:00:00.000 UTC
5 42 01/03/2011 00:00:00.000 UTC
6 0 01/03/2011 00:00:00.000 UTC
7 0 01/03/2011 00:00:00.000 UTC
8 0 01/03/2011 00:00:00.000 UTC
9 0 01/03/2011 00:00:00.000 UTC
10 0 01/03/2011 00:00:00.000 UTC
クエリの出力が正しくありません。以前にこの問題に遭遇した人はいますか? ここにいくつかの追加情報があります。
> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] timeDate_2130.92 data.table_1.5.3 RODBC_1.3-2
loaded via a namespace (and not attached):
[1] tools_2.12.1