sqlSave()를 사용하여 SQL Server의 테이블에 데이터 프레임을 업로드하려고합니다.이 데이터 프레임에는 타임 스탬프가 포함되어 있으며 timestamp col을 sqlserver의 datetime col에 매핑하고 싶습니다.sqlSave : SQL Server 타임 스탬프에 데이터 프레임 타임 스탬프 매핑
두 가지 문제가 발생합니다.
1. 데이터 프레임의 타임 스탬프를 float로 매핑합니다. 2. 테이블을 만들지 만 데이터가 업로드되지 않아 오류가 발생합니다. 나는 데이터 유형을 볼 때, 또한 ...
> sqlSave(dbandle,mdf,tablename="mdf")
Error in sqlSave(dbandle, mdf, tablename = "mdf") :
[RODBC] Failed exec in Update
22018 0 [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification
내가 SQL Server 데이터베이스에 sqlSave을하려고 할 때
이mdf <- structure(list(run = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("run_00",
"run_01", "run_02", "run_03", "run_04"), class = "factor"), slot = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = c("slot 3", "slot 4", "slot 5",
"slot 6"), class = "factor"), timestamp = structure(c(1320774563,
1320774624, 1320774686, 1320774747, 1320774809, 1320774871), class = c("POSIXct",
"POSIXt"), tzone = ""), channel = structure(c(1L, 1L, 1L, 1L,
1L, 1L), .Label = c("och01", "och02", "och09", "och10"), class = "factor"),
variable = structure(c(2L, 2L, 2L, 2L, 2L, 2L), .Label = c("num_blocks",
"num_collection", "num_corr_0", "num_corr_1", "num_uncorr_srow",
"post_fec_err_rate", "pre_fec_err_rate"), class = "factor"),
value = c(1, 62, 124, 185, 247, 309)), .Names = c("run",
"slot", "timestamp", "channel", "variable", "value"), row.names = c(NA,
6L), class = "data.frame")
> mdf
run slot timestamp channel variable value
1 run_00 slot 3 2011-11-08 12:49:23 och01 num_collection 1
2 run_00 slot 3 2011-11-08 12:50:24 och01 num_collection 62
3 run_00 slot 3 2011-11-08 12:51:26 och01 num_collection 124
4 run_00 slot 3 2011-11-08 12:52:27 och01 num_collection 185
5 run_00 slot 3 2011-11-08 12:53:29 och01 num_collection 247
6 run_00 slot 3 2011-11-08 12:54:31 och01 num_collection 309
여기 무슨 일이야 : 여기
는 예를 들어 데이터 프레임, MDF의 테이블의 "datetime"을 얻지 못했습니다. RODBC가 POSIXct 타임 스탬프를 datetime 이외의 다른 것으로 매핑하는 이유는 내게 의미가 없습니다.[rownames] [varchar](255) NULL,
[run] [varchar](255) NULL,
[slot] [varchar](255) NULL,
[timestamp] [float] NULL,
[channel] [varchar](255) NULL,
[variable] [varchar](255) NULL,
[value] [float] NULL
어떻게이 문제를 해결할 수 있습니까?