[R-sig-DB] my Problem with the RODBC sql script below
Alemu Tadesse
@|emu@t@de@@e @end|ng |rom gm@||@com
Sat Mar 7 01:54:26 CET 2015
Dear All,
The following script works in sql server or toad for sql server.
SELECT MD.CallSign
,HD.WBAN
,TimeStamp_Local
,ref_density
,ref_dewpoint
,ref_dir
,ref_precip
,ref_press
,ref_rh
,ref_temperature_avg
,ref_ws_avg
,ref_wetbulb
FROM ASOS.dbo.HourlyData HD
left outer join ASOS.dbo.ASOS_MetaData MD on MD.WBAN = HD.WBAN
where CallSign = 'BOS' order by TimeStamp_Local ASC
and the result is a table of the data corresponding to those variables
listed above
But, in R it doesn't work with the following commands
ch1 <- odbcConnect(dsn="COLOMSQ", uid="DataPull", pwd="Puldata")
p3<-sqlQuery(ch1,'SELECT MD.CallSign
,HD.WBAN
,TimeStamp_Local
,ref_density
,ref_dewpoint
,ref_dir
,ref_precip
,ref_press
,ref_rh
,ref_temperature_avg
,ref_ws_avg
,ref_wetbulb
FROM ASOS.dbo.HourlyData HD
left outer join ASOS.dbo.ASOS_MetaData MD on MD.WBAN = HD.WBAN
where CallSign = BOS order by TimeStamp_Local ASC')
close(ch1)
and p3 results in
[1] "08S01 0 [Microsoft][ODBC SQL Server Driver]Communication link failure"
[2] "[RODBC] ERROR: Could not SQLExecDirect 'SELECT MD.CallSign\n
,HD.WBAN\n ,TimeStamp_Local\n ,ref_density\n
,ref_dewpoint\n ,ref_dir\n ,ref_precip\n ,ref_press\n
,ref_rh\n ,ref_temperature_avg\n ,ref_ws_avg\n
,ref_wetbulb\n FROM ASOS.dbo.HourlyData HD\n left outer join
ASOS.dbo.ASOS_MetaData MD on MD.WBAN = HD.WBAN\nwhere CallSign = BOS order
by TimeStamp_Local ASC'"
with no data
Any idea ?
Thank you in Advance
[[alternative HTML version deleted]]
More information about the R-sig-DB
mailing list