sqlQuery: impossible to get the ID number as Character into R?

前端 未结 2 415
生来不讨喜
生来不讨喜 2021-01-18 06:26

I\'m using the RODBC package inside an ORACLE DATA BASE (DB). Everything is doing very well, but I need to obtain a table from this DB and some variables as cha

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-18 06:49

    This works for me:

    library(RODBC)
    con <- odbcDriverConnect('driver={SQL Server};server=[your server name];database=[your database name];trusted_connection=true')
    ManzResul_VIII<-sqlQuery(con,"select distinct ('m' + id) as id from [your table]")
    

提交回复
热议问题