none
Problem with Microsoft Client - ScaleR Query RRS feed

  • Question

  • I am attempting to test ScaleR with the following R code:

    connection <- "Driver=SQL Server; Server=FS-18501\\SQLServer2016; Database=ODS; trusted_connection=true"
    sqlQuery <- "Select Top 100 * From dbo.PanelEfficiency"
    resultSet <- RxSqlServerData(connectionString = connection, sqlQuery)
    serverContext = RxInSqlServer(connectionString = connection, wait = T)
    rxSetComputeContext(serverContext)
    rxGetVarInfo(data = resultSet)

    When I execute the last line of code, I get the following error: 

    [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'Select'.
    [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'Select'.Error in doTryCatch(return(expr), name, parentenv, handler) : 
    [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'Select'.

    The query is valid. I cannot see what the problem is.


    Randy Minder

    Friday, August 5, 2016 2:51 PM

All replies

  • Hi Randy,

    It appears to be related to the initialization of the sqlQuery argument of RxSqlServerData. i.e. this should work for you:

    mySqlQuery <- "Select Top 100 * From dbo.PanelEfficiency"
    resultSet <- RxSqlServerData(connectionString = connection, sqlQuery=mySqlQuery)

    Thanks,

    Dotan

    Friday, August 5, 2016 5:46 PM