ODBC Teradata connection Julia - odbc

I am trying to connect to Teradata using ODBC in Julia using the following but I am getting an error:
co = ODBC.connect(dsn = "DBS", uid = "me", pwd = "xxx")
Error:
>ArgumentError: function connect does not accept
I've installed the ODBC package and if I run ODBC.listdsns() I can see a list of available DSNs, one of which I am using in my connection string. I've tried a few other variants that are listed in the documentation but I get the same error message.
I have been using the above connection string in R so I'm confident that I can connect with ODBC but I only installed Julia over the weekend so I am still getting to grips with it.
Any help would be much appreciated.

Related

R Code works fine in RStudio but not in terminal - ODBC SQL - Failed to load the security library: (libgssapi_krb5.dylib)

I have some R code made in RStudio. It connects to SQL-Server, runs a query and saves out a csv.
It runs fine in RStudio but i want it to run in terminal so I can schedule it daily.
I have tried googling the error message for I can't seem to find what im looking for.
The SQL server authenticates with Windows Auth. Therefor im not suppling a username and password.
library(odbc)
con <- dbConnect(odbc::odbc(),.connection_string = "Driver={Simba SQL Server ODBC Driver};
Server=MYSERVER;
Database=TEST;
trusted_connection=true")
This is the error message I'm getting:
Error: nanodbc/nanodbc.cpp:950: HY000: [Simba][Support] (50366) Failed to load the security library: (libgssapi_krb5.dylib)
Execution halted
I'm really new to R so I'm not too sure whats happening, any help would be really appreciated.
Thanks!

how to read data from Cassandra (DBeaver) to R

I am using Cassandra CQL- system in DBeaver database tool. I want to connect this cassandra to R to read data. Unfortunately the connection takes more time (i waited for more than 2 hours) with RCassandra package. but it does not seem to get connected at all and still loading. Does anyone has any idea on this?
the code as follows:
library(RCassandra)
rc <- RC.connect(host ="********", port = 9042)
RC.login(rc, username = "*****", password = "******")
after this step RC.login, it is still loading for more than 2 hours.
I have also tried using RJDBC package like posted here : How to read data from Cassandra with R?.
library(RJDBC)
drv <- JDBC("org.apache.cassandra.cql.jdbc.CassandraDriver",
list.files("C:/Program Files/DBeaver/jre/lib",
pattern="jar$",full.names=T))
But this throws error
Error in .jfindClass(as.character(driverClass)[1]) : class not found
None of the answers are working for me from the above link.I am using latest R version 3.4.0 (2017-04-21) and New version of DBeaver : 4.0.4.
For your first approach, which I am less familiar with, should you not have a line that sets the use of the connection?
such as:
library(RCassandra)
c <- RC.connect(host ="52.0.15.195", port = 9042)
RC.login(c, username = "*****", password = "******")
RC.use(c, "some_db")
Did you check logs that you are not getting some silent error while connecting?
For your second approach, your R program is not seeing a driver in a classpath for Java (JMV).
See this entry for help how to fix it.

Connect Oracle DB through RStudio using RODBC

I might be re-asking the question but I am having difficulty creating connection to Oracle DB which is on a remote server. I am new to R and Oracle DB so I do not have much experience. I am using RStudio. I have installed RODBC package successfully. I am using Ubuntu 14.04 Operating System.
Firstly I use library RODBC
library("RODBC", lib.loc="~/R/x86_64-pc-linux-gnu-library/3.0")
Then I have entered following command:
odbcConnect(dsn = "DatabaseName", uid = "UserID", pwd = "Password")
I get the following error:
[1] -1
Warning messages:
1: In RODBC::odbcDriverConnect("DSN=DatabaseName;UID=UserID;PWD=Password") :
[RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data source name not found, and no default driver specified
2: In RODBC::odbcDriverConnect("DSN=DatabaseName;UID=UserID;PWD=Password") :
ODBC connection failed
I have searched but I am not getting to anywhere. Please tell me process or steps to how I can make a connection.
Thank You!

The used command is not allowed with this MySQL version within R Studio

I have a MYSQL (which I'm very new to) database hosted on azure, which i'm trying to write data to from RStudio using the RMySQL package.
I am receiving the following message
> dbWriteTable(searchdb,"searchrecords",data, append = TRUE)
Error in .local(conn, statement, ...) :
could not run statement: The used command is not allowed with this MySQL version
Can anybody provide a suggestion as to why this may be?

Connect R and Vertica using RODBC

This is my first time connecting to Vertica. I have already connected to a MySQL database sucessfully by using RODBC library.
I have the database setup in vertica and I installed the windows 64-bit ODBC driver from https://my.vertica.com/download-community-edition/
When I tried to connect to vertica using R, I get the below error:
channel = odbcDriverConnect(connection = "Server=myserver.edu;Database=mydb;User=mydb;Password=password")
Warning messages:
1: In odbcDriverConnect(connection = "Server=myserver.edu;Database=mydb;User=mydb;Password=password") :
[RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
2: In odbcDriverConnect(connection = "Server=myserver.edu;Database=mydb;User=mydb;Password=password") :
ODBC connection failed
Can someone tell me how to fix this? Or is there any other ways to connect to vertica using R?
It may not be the fastest, but I prefer to use the Vertica JDBC driver from R. Getting the ODBC drivers working is a little messy across different operating systems. If you already have a Java Runtime Environment (JRE) installed for other applications then this is fairly straightforward.
Download the Vertica JDBC drivers for your Vertica server version from the MyVertica portal. Place the driver (a .jar file) in a reasonable location for your operating system.
Install RJDBC into your workspace:
install.packages("RJDBC",dep=TRUE)
In your R script, load the RJDBC module and create an instance of the Vertica driver, adjusting the classPath argument to point to the location and filename of the driver you downloaded:
library(RJDBC)
vDriver <- JDBC(driverClass="com.vertica.jdbc.Driver", classPath="full\path\to\driver\vertica_jdbc_VERSION.jar")
Make a new connection using the driver object, substituting your connection details for the host, username and password:
vertica <- dbConnect(vDriver, "jdbc:vertica://host:5433/db", "username", "password")
Then run your SQL queries:
myframe = dbGetQuery(vertica, "select Address,City,State,ZipCode from MyTable")
You have to use double slash in the classPath arguement in JDBC function.
for example,
vDriver <- JDBC(driverClass="com.vertica.jdbc.Driver",
classPath="C:\\Program Files\\Vertica Systems\\JDBC\\vertica-jdk5-6.1.2-0.jar")
worked for me, while just copying and pasting the route failed.

Resources