Displaying 20 results from an estimated 6000 matches similar to: "How to call stored procedure from RODBC?"
2002 Sep 04
1
Passing dynamic sql statement to RODBC functions
Hi,
Does anyone know how to pass dynamic sql statement to RODBC function
"odbcQuery()" or "sqlQuery()"?
eg.: under R session, I did:
>library(RODBC)
>channel<-odbcConnect(...)
>data1<-2.5
>data2<-5.0
I want to construct the INSERT sql statement using variables "data1" and
"data2" and pass this statement to odbcQuery() . Can I do this?
2003 Jul 09
2
RODBC and Oracle: error "table does not exist"
Dear r-helpers!
I have trouble reading data from an Oracle data base using
RODBC Version 1.0-3,
R Version 1.7.1,
Windows XP,
Oracle8 ODBC Driver Version 8.1.6.4.0:
> library(RODBC)
> channel <- odbcConnect(dsn="PAV32", case="oracle", believeNRows=FALSE)
> # ok, this was succesful
> x <- sqlTables(channel)
> x[37, ]
TABLE_CAT TABLE_SCHEM TABLE_NAME
2007 Jul 17
4
[R-sig-DB] RODBC on Oracle DB
essai <- odbcConnect("ORESTE_prod", uid="osis_r", pwd="12miss15" ,case="oracle")
> sqlTables(essai)$ORESTE
...
1315 <NA> ORESTE S_PROFESSIONS_OLD TABLE <NA>
1316 <NA> ORESTE S_PROVENANCES TABLE <NA>
1317 <NA> ORESTE
2007 Mar 06
2
Package RODBC
I have some questions about the RODBC package.
library(RODBC) # required for those who want to repeat these lines
1st, I noticed that the following sequence does not work:
channel <- odbcConnextExcel("test.xls")
tables <- sqlTables(channel)
name1 <- tables[1, "TABLE_NAME"] # this should be the name
plan1 <- sqlFetch(channel, name1) # bang!
2008 Jul 23
2
Using RODBC to use SQL queries
Hello,
I am new to the RODBC package, but I have looked over the PDF as well as a few websites that go over the SQL language. I can connect to my database fine using
>channel<-odbcConnect("Oracle ODBC")
# then am prompted to enter my user id and password
After that I'd like to use the odbcQuery function and the SQL statement:
SELECT * FROM table_name WHERE SAMPLE_YEA LIKE
2012 Nov 26
2
puzzling RODBC error
Dear all,
I'm trying to connect to an MSAccess database (ArcGIS personal geodatabase). I keep getting an error about the channel when using sqlQuery(). However, sqlTables() does not complain about the channel and lists all tables in the database. If I try sqlFetch(), then R crashes.
I'm happy to hear suggestions on how to solve this.
Best regards,
Thierry
> MDB <-
2009 Aug 14
1
RODBC does not like table names >11/12 characters
Hi List,
I used to access a Paradox database using RODBC, but since last week I
am not able anymore to fetch any table which has a name longer than 11
or 12 characters.
Here is the the pattern of my code, nothing spectacular:
library(RODBC)
channel2<-odbcDriverConnect('DSN=xxx')
#table names with up to 11 characters still work
sqlFetch(channel2, 'abcdefghijk')
#table names
2002 Sep 05
0
AW: Passing dynamic sql statement to RODBC functions
You could construct your SQL statement as a character string using paste()
and pass this as an argument to sqlQuery.
Maybe something like this will work for you:
>data1<-2.5
>sql.statement <- paste("SELECT * FROM somewhere WHERE something=", data1,
";", sep="")
>library(RODBC)
>channel <- odbcConnect(...)
>sqlQuery(channel, query =
2003 Sep 23
1
RODBC access to MS-Excel (PR#4266)
Full_Name: Michael Hecht
Version: 1.7.1
OS: WinNT
Submission from: (NULL) (193.158.76.205)
I've got a problem with the RODBC library while trying to access to an MS-Excel
file. The Excel file was originally exportet by a commercial software, so I
cannot influence it. The problem is, that the names of the tables include
spaces, e.g. "Scan 1","Scan 2" etc. If I use RODBC, I
2007 Jul 06
2
RODBC problem
Hello,
I use a RODBC connection to a MySQL server on a Debian machine. The call to odbcConnect() seems to be ok, but the result of the first sqlFetch(channel,"t_studie") retrieves this data frame:
[1] "[RODBC] ERROR: Could not SQLExecDirect"
[2] "42000 1064 [MySQL][ODBC 3.51 Driver][mysqld-5.0.22-Debian_1bpo1-log]You have an error in your SQL syntax; check the manual
2009 Jul 15
1
RODBC results from stored procedure
Short of uploading a SQL server database, I don't think I can make this
example reproducible, but I hope it's not so complicated as to require
reproducibility....
I'm using RODBC to get data from Microsoft SQL Server.
I can call a parametrized stored procedure without a problem and the proc
does indeed execute successfully. However, even though the proc returns the
results I found
2002 Aug 28
1
RODBC: sqlFetch and its argument sqtable
Calling function "sqlFetch" in library(RODBC) and specifying a character
string as 2nd argument, I get an error I don't understand:
library(RODBC)
channel <- odbcConnect("mydatabase.mdb", case="msaccess")
sqlFetch(channel, "mytable")
# this works fine
tabname <- "mytable"; sqlFetch(channel, tabname)
# this gives an error:
# Error in
2002 May 10
2
RODBC for importing dbf
Hi
I know that it is very easy to import data from a dbf file to R, by
saving the data as csv, for instance.
However, I have several hundreds of files to do that. So, I thought of
using RODBC to read the dbf files and save it as data.frame. However, I
cannot even start (this is my first time using such package):
> library(RODBC)
> bdades <- odbcConnect("prova.DBF")
Warning
2000 Aug 28
2
Windows / RODBC / Accented characters
A disturbing behaviour of R: an import of data using RODBC library
(Windows 98, R 1.1.1) recognizes accented characters in variables
names but these can't be manipulated further. See below:
> library(Rodbc)
> ch<-odbcConnect("Paradox Files")
> pollut<-sqlFetch(ch,Pollutio)
> pollut
Mortalit? Densit? Pollution
1 82 600 110
2 97 960
2012 Feb 16
1
Reading Text Files with RODBC
I'm thoroughly stumped. I've been playing with RODBC and wanted to see if I could retrieve data from text files using this package as well (for the most part, this is an intellectual exercise, but occasionally I do get data files large enough in CSV format RODBC could be helpful) .
I set up a DNS called "Text Files" and then ran the following code in R
> library(RODBC)
2002 Jul 18
2
RODBC and Excel Files
Hello,
I am trying to play with RODBC library and Excel Files. In my file
(doubs.xls) there are 2 spreadsheets:
> library(RODBC)
> connection<-odbcConnect("Excel Files")
> sqlTables(connection)
TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS
1 F:\\Th?se\\R\\Doubs NA Faune$ SYSTEM TABLE NA
2 F:\\Th?se\\R\\Doubs NA Milieu$
2011 Jan 23
3
Problem reading PostgreSQL data with RODBC
Dear list -
I am having a problem using RODBC to access records from tables in a PostgreSQL database.
There is no problem establishing the connection using chnl <- odbcConnect (dsn= ... etc.
The DSN seems to be properly set up using the PostgreSQL Unicode ODBC driver, and
sqlTables(chnl) works OK and produces a list of tables in the database (they are all in a schema called 'source').
2006 Oct 17
2
RODBC and NULL values
Dear All,
Writing sooner than I thought I'd need to.
I'm using R 2.4 on Mac OS X, with RODBC, PostgreSQL 8.1 and Actual's
ODBC driver. I have all my data in Filemaker 8.5, but it is
automatically exported into PostgreSQL for analysis as Filemaker's ODBC
and JDBC access is awful, slow and has a tendency to crash.
I have disability data where for each patient there is a survival
2002 May 30
2
RODBC & Problems with Sybase Database
Hello,
i would like import Data from Sybase DataBase to R-1.5.0 via RODBC.
With this i get a connection without problems !
channel <- odbcConnect("ODBCName","LoginName","LoginPass")
dataSybase <- sqlFetch(channel,"EPORT_XYZ")
,but when i try this i get a message error ?
(Perhaps the _ is a problem, i know that's i.e. not usual to name
2002 May 11
2
RODBC sqlFetch
Hi,
Thanks for showing me how to use RODBC and odbcConnect.
Now works nicely. The question I've got now is:
noms <- list.files(pattern=".DBF")
# removing extension names:
noms <- sapply(noms, function(x) as.character(strsplit(x,".DBF")) ,
USE.NAMES=F)
for (i in 1:length(noms)) {
s <- sqlFetch(bdades, noms[i])
# etc.
}
But it seems that sqlFetch()