Hi All,
I updated several packages on my PC for the Rstudio Modelling course. I wanted to follow along.
I also updated several other packages related to Databases specifically ODBC
I have recently been getting the error
" The procedure entry point_crtlnitializeCriticalSectionEx could not be located in the dynamic link libraryC:\Program\Files\Teradata\Client\15.00\bin\lib\terasso.dll."
I have googled around and found 2 links that suggest re-installing the teradata ODBC drivers (See 1 and 2). I have gotten my local IT to do this and while it works with other applications for example SQL Assistant, rsession.exe throws up the error above when trying to connect to the DB
Any help would be greatly appreciated
Thank you for your time
run_query <- function(db, sql) {
tryCatch(
expr = {
con <- RODBC::odbcConnect(db)
df <- RODBC::sqlQuery(channel=con, query = sql)
RODBC::odbcCloseAll()
df
},
error = function(e){
message('There was a problem executing the SQL statement')
print(e)
RODBC::odbcCloseAll()
},
finally = {
status <- RODBC::odbcCloseAll()
}
)
}
# To Run the SQL
strSQL = "SELECT * FROM foo"
results <- run_query(strSQL , db = "DNS_NAME")