Displaying 20 results from an estimated 9000 matches similar to: "Passing dynamic sql statement to RODBC functions"
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 =
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
2011 Dec 20
1
RODBC Error: 'getCharCE' must be called on a CHARSXP
I am trying to connect to an internal database and use the sqlQuery command to reduce and retrieve data using the following code:
channel <-odbcConnect("some_dsn", uid="", pwd="")
txt<-'SELECT Date, Region, Price FROM TableXYZ WHERE Type="Domestic"'
sqlQuery(channel, cat(txt,"\n"),errors=TRUE,)
close(channel)
However, I get the
2012 Aug 27
1
Querying sqlite through RODBC causes R to crash
Dear R-SIG-Debian,
while trying to query data from an SQLite database through RODBC on
Debian testing, R crashes with the following message:
library(RODBC)
con3 <- odbcConnect("test3")
# 'test3' being an ODBC datasource configured with SQLite3 driver,
# but the same happens with SQLite driver
sqlQuery(con3, "select * from test") # 'test' being any table
2002 Aug 02
1
R to Oracle via RODBC
Howdy,
I'm trying to use R to access Oracle 8i using the RODBC package On Linux
Red Hat 7.3.
Specs
R version 1.51
Driver: Easysoft ODBC - Oracle driver
Driver Manager: unixODBC
I get the following error when trying to executing RODBC commands. Can
anybody give me pointers as to what I'm missing or doing wrong
> library(RODBC)
> channel <- ("DSNName")
>
2009 Sep 21
1
RODBC : using and passing queries that use " in some arguments
Dear R users,
I am trying to connect R to data that is in a Access Database but I have problem with the construction of queries using special characters.
I am using RODBC package.
The following is working :
> MyQuery<-paste("SELECT first( (DateHeure) ) , avg(NNO3_AT322_OUT_moy) AS Cond FROM Colonne_3 ")
> Col3<-sqlQuery(con, query=MyQuery)
> Col3
2007 Aug 14
4
Import of Access data via RODBC changes column name ("NO" to "Expr1014") and the content of the column
Dear all,
I have some problems with importing data from an Access data base via
RODBC to R. The data base contains several tables, which all are
imported consecutively. One table has a column with column name "NO". If
I run the code attached on the bottom of the mail I get no complain, but
the column name (name of the respective vector of the data.frame) is
"Expr1014" instead
2002 Sep 19
1
How to call stored procedure from RODBC?
Hi,
Does anyone know how to call stored procedure from RODBC? Thanks.
Lingyun
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2007 Sep 29
1
RODBC and Oracle
Hi WizaRds,
I'm experiencing a problem connecting to an Oracle 10g database via RODBC
(I'm getting this on Microsoft XP).
The same SQL queries via PL/SQL Developer work just fine, but when I pump the query through sqlQuery in RODBC then I get a data frame back with 0 rows.
I cut the query down alternating between PL/SQL and RODBC until I figured
that it's some kind of row limit or
2009 May 25
3
Interpolating variables within (RODBC library) SQL statements for MySQL
Hi everyone,
I am desperately looking for a method to interpolate strings within an SQL
statement as follows:
I get a lot of rows out of a database (in my example POSITION_to_ZIPCODE
Database with holds records for German ZIP Code <--> Gauss-Krueger
Coordinate System ) and want this to be selected and computed individually
row by row as follows:
library(RODBC)
channel <-
2006 Feb 27
4
prepared query with RODBC ?
Dear List,
Would anyone know how to perform prepared queries with ROBC ?
I had a shot with some of the internal (non-exported) functions of the package
but ended up with a segfault, so I prefer asking around before
experimenting further...
Thanks,
Laurent
2004 Apr 30
0
RODBC & MS SQL Server: repeated calls to sqlGetResults() problem
Dear list,
RODBC is mostly working very well on Windows XP talking to MS SQL Server.
However, when trying to retrieve a result set in repeated batches the first
batch returns results ok, but then subsequent calls return no data (see code
below). I tried setting believeNRows=FALSE both in odbcConnect() and in
sqlGetResults() but this doesn't appear to make any difference. Also
odbcFetchRows()
2008 Mar 03
0
reducing RODBC odbcQuery memory use?
1. Can I avoid having RODBC use so much memory (35 times the data size or more) making a data.frame & then .rda file via. sqlQuery/save?
2. If not, is there some more appropriate way from w/in R to pull large data sets (2-5GB) into .rda files from sql?
[R] reducing RODBC odbcQuery memory use?
From: WILLIE, JILL <JILWIL_at_SAFECO.com>
Date: Thu 25 Jan 2007 - 22:27:02 GMT
2007 Jan 26
0
FW: reducing RODBC odbcQuery memory use?
New to R, sorry if one or either of these is an inappropriate list for a
question like this below; please let me know if this is a general help
question.
Jill Willie
Open Seas
Safeco Insurance
jilwil at safeco.com
-----Original Message-----
From: WILLIE, JILL
Sent: Thursday, January 25, 2007 2:27 PM
To: r-help at stat.math.ethz.ch
Subject: reducing RODBC odbcQuery memory use?
Basic
2003 Apr 01
1
RODBC, freetds, and MS SQL Server
I have a question for RODBC users out there. I have used the package with
good results for some time. However, I have just switched from an OpenLink
proprietary driver for MS SQL to the FreeTDS driver (I think it is MS SQL
Server 2000 I'm connecting to if it matters). I was/am running them from
unixODBC on a Linux Client. I think I have it set up fine since I can use
"isql"
2008 Sep 24
0
Error results from MS Access via RODBC
I have an MS Access database with one table and one column holding rep(1:10)
I use:
library(RODBC)
channel <- odbcConnect("test")
sqlQuery(channel, paste("SELECT col FROM tblTest"), believeNRows=FALSE)
and get:
49
50
51
52
53
54
55
56
57
12337
What? The above should, of course, read:
1
2
3
4
5
6
7
8
9
10
I tried the 'odbcQuery' /
2010 Jan 24
0
Setting thevalue of max in calls to sqlGetResults
I have compiled and linked a 64 bit version of R (R 2.9.2) and the
corresponding unix ODBC 64 bit package
When issuing a SqlQuery, I get the following error
> library(RODBC)
> channel <- odbcConnect("OraLSH", <user>, <password>)
> sqlQuery(channel,"select sysdate from dual")
Error in .Call(C_RODBCFetchRows, attr(channel, "handle_ptr"), max,
2010 Jan 24
0
Setting the value of max in calls to sqlGetResults
I have compiled and linked a 64 bit version of R (R 2.9.2) and the
corresponding unix ODBC 64 bit package
When issuing a SqlQuery, I get the following error
> library(RODBC)
> channel <- odbcConnect("OraLSH", <user>, <password>)
> sqlQuery(channel,"select sysdate from dual")
Error in .Call(C_RODBCFetchRows, attr(channel, "handle_ptr"), max,
2008 May 05
2
RODBC and schemas
I have found that the "schema.table" syntax used in Postgresql (and
Oracle) does not work directly with RODBC.
This works
library(RODBC)
con<-odbcConnect("mydb")
d<-sqlQuery(con,"select * from meso.trees")
However this does not.
d<-sqlFetch(con,"meso.trees")
Error in odbcTableExists(channel, sqtable) :
?meso.trees?: table not found on channel
2009 Jan 30
1
run query using rexcel runrfile and rodbc sql query
Hi,
I'm using R-2.8.1 for windows. I wrote a script calls the RODBC
package to run sql queries against an oracle database. It runs fine
when run from the rconsole and returns a data.frame with a summary for
a set of experiments. I want to run this script using the
rinterface.RunRFile command in an excel plugin, using the rexcel
package. When I run the code from my excel plugin I