Displaying 20 results from an estimated 96 matches for "odbcclose".
2005 Apr 19
2
RODBC odbcCloseAll odbcClose Windows XP
Hello...
After installing the precompiled version of R 2.1.0 (congratulations
to the R Development Core Team) for Windows XP (Service Pack 2), I'm
having problems with the "odbcCloseAll" and "odbcClose" functions
within the "RODBC" package. I get pretty much the same error message
for both functions:
odbcCloseAll() produces:
Error in .Call("RODBCCloseAll", PACKAGE = "RODBC") :
"C" function name not in DLL for pac...
2009 Nov 18
3
Re ading multiple Excel 2007 files with a loop
...on a computer running Windows (XP, I think):
library(RODBC)
channel <- odbcDriverConnect("DRIVER=Microsoft Excel Driver (*.xls, *.xlsx,
*.xlsm, *.xlsb);
DBQ=U:\\test folder\\testA.xlsx; ReadOnly=False")
sqlTables(channel)
my.data.A <- sqlFetch(channel, "Sheet1")
odbcClose(channel)
channel <- odbcDriverConnect("DRIVER=Microsoft Excel Driver (*.xls, *.xlsx,
*.xlsm, *.xlsb);
DBQ=U:\\test folder\\testB.xlsx; ReadOnly=False")
sqlTables(channel)
my.data.B <- sqlFetch(channel, "Sheet1")
odbcClose(channel)
channel <- odbcDriverConnect...
2007 Jan 16
0
Rgui crashes when calling odbcClose()
...I'm running Rgui v2.4.0, RODBC v1.1-8, and psqlODBC v8.2.0002. Whenever
I do the following
chan <- odbcConnect("mydatabase", uid="admin") # connection to a
postgresql db on a linux box
tmp <- sqlQuery(chan, "select * from sometable;") # this is successfull
odbcClose(chan) # this crashes Rgui and raises an error window
containing the following MS error signature:
AppName: rgui.exe AppVer 2.4.39566.0 ModName: psqlodbc35w.dll
ModVer: 8.2.0.2 Offset: 00003248
I didn't find anything relevant in the R Windows FAQ or a few queries of
the help archives; a...
2006 Sep 19
1
RODBC Connections closed automatically in background
...y before
I am done with it.
Here is my code:
foo <- function(dsn) {
db <- odbcConnect(dsn)
odbcSetAutoCommit(db, FALSE)
data <- someDatabaseOperation(db)
data2 <- someLongCalculation(data)
anotherDatabaseOperation(db, data2) # This often fails b/c the db is no longer open.
odbcClose(db)
}
I see some output:
Warning: closing unused RODBC handle 9
Warning: [RODBC] Error SQLDisconnect
Warning: [RODBC] Error SQLFreeconnect
Warning: [RODBC] Error in SQLFreeEnv
Error in odbcGetErrMsg(channel) : first argument is not an open RODBC channel
I suspect that during the call t...
2007 Mar 06
2
Package RODBC
...nt 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!
odbcClose(channel)
However, I can circumvent this with:
channel <- odbcConnextExcel("test.xls")
tables <- sqlTables(channel)
name1 <- tables[1, "TABLE_NAME"] # this should be the name
plan1 <- sqlQuery(channel, sprintf("select * from [%s]", name1)) # ok...
2011 Feb 10
2
Rioja package, creating transfer function, WA, "Error in FUN"
...uggled to find similar problems to this online. Is there a
step I've missed out between assigning the matrices and the WA function?
> SWED=odbcConnectExcel(file.choose()) (SWED is the environmental data
> file)
> sqlTables(SWED)
> Env=sqlFetch(SWED, "Sheet1")
> odbcClose(SWED)
> Env
SampleId WTD Moisture pH EC
1 "N1_1" "20" "91.72700" "3.496674" " 85.02688"
2 "N1_2" " 2" "93.88913" "3.550794" " 85.69465"
3 "N1_3" "26...
2001 May 14
1
RODBC: closing databases
...unction(Type, Table){
if(!is.element("package:RODBC", search())){
cat("Loading RODBC package", "\n")
invisible(library(RODBC))
}
Channel <- odbcConnect(Type)
query <- paste("select * from", Table)
tab <- sqlQuery(Channel, query)
odbcClose(Channel)
tab
}
Then something like:
CaPds <- getTable(Type = "VFP", Table = "CaPds")
does the job: the data.frame is quickly and properly obtained. However,
when I go back to the database management system and try to update the
original table, I get an error message sa...
2006 Oct 18
2
sqlSave, fast=F option, bug?
Hi,
Using the fast=F option, sqlSave saves without matching column names.
It looks like a bug to me..........
Here's a simple (artificial) example.
-----------------------------------------
Create a dataframe and save it to a database table "test" as follows:
df <- data.frame(T=1, S=10)
sqlSave(channel, df, "test", rownames=F)
The table now looks like
T S
1 10
If
2012 May 29
1
RODBC, Excel, and data truncation when writing
...xample code and the warning message received:
library(RODBC)
d <- data.frame(v1=c(1,2),v2=c(paste(rep("test",100),collapse=""),"test"))
z <- odbcConnectExcel2007("test_rodbc.xlsx",readOnly=FALSE)
sqlSave(z,d,tablename="Sheet1",rownames=FALSE)
odbcClose(z)
Warning message:
In odbcUpdate(channel, query, mydata, coldata[m, ], test = test, :
character data
'testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest...
2003 Aug 06
1
RODBC with Windows XP
Hi R-Users,
I have very recently switched from using R on windows 2000 to windows XP
Professional. With XP I am having problems
using the "odbcConnect("")" command. I can use the command perfectly well
until I close the database channel
with the command "odbcClose(channel)". When I try and re-establish
connection following the close command no dialog box appears
and an error message is displayed.
I am using version 1.6.2 of R.
The following is an example of this bewildering problem.
> library(RODBC)
> channel<-odbcConnect("")
&...
2006 Oct 05
2
Variables in RODBC environment
...ot work:
Thanks for your help.
Thorsten
pn <- '39R5238';
library(RODBC);
odbcobj <- odbcConnect("SQUIT21C",uid="muehge",pwd="xxx");
sql <- "select
u.unitid,
from test
where part in ('pn')
";
parameter <- sqlQuery(odbcobj,sql);
odbcClose(odbcobj);
2007 Apr 19
2
element search
...brary(RODBC)
channel <- odbcConnectExcel("data2.xls")
tables <- sqlTables(channel) # list the names of the spreadsheets
name1 <- tables[1, "TABLE_NAME"] # get the name of the 1st spreadsheet
plan1 <- sqlQuery(channel, sprintf("select * from [%s]", name1))
odbcClose(channel) # close it
Now I want to store each row in variable. Additionally the result should
be a list again so that I can handle each entry for itself. Ideas?
Perhaps a list again?
Now I want to find on the one hand in each row one special entry and on
the other hand I need to get the maximum e...
2009 Jan 26
2
R crashes when using the RODBC Package
..., but if I put a loop around
the code so that I fetch data from a different source table, and then save
it again to a different destination table, the code crashes. It is either
the final sqlQuery or sqlSave queries. I have no idea why it is crashing.
As an aside, I also have trouble with the odbcCloseAll() command - R tends
to crash with that, also.
I'm running this on Windows XP, Access 2003, R version 2.7.2
Any insights would be greatly appreciated! The condensed version of the
code is below.
# import the libraries
library(RODBC)
# Close any existing connections
odbcC...
2012 Aug 01
2
Why the result is coming as NULL?
Why the result is coming as NULL. Can anyone help. I want to find the outliers for a reference
setwd("D:/AZ")
library("RODBC")
cdb_cnct <- odbcConnectExcel("Book1.xls")
cdb_frame <- sqlFetch(cdb_cnct, "Sheet1")
odbcClose(cdb_cnct)
rm(cdb_cnct)
x<- cdb_frame$Publication >=1990 & cdb_frame$Publication <=2012
invalid <- cdb_frame[!x, c("Reference")]
invalid
________________________________
Notice: The information contained in this electronic mail message is intended only for the use of the...
2006 Mar 23
0
sqlSave
...ally succeeded in exporting my dataframes from R into Access with
this script:
library(RODBC)
canal <- odbcConnectAccess("D:/Floristique.mdb")
sqlSave(channel=canal, dat=flore, tablename="Floristique", rownames=F,
safer=F, fast=F,
varTypes=c(dates="Date"))
odbcClose(canal)
My problem in exporting my dataframe "flore" seems to be closely linked
with the name of the column of dates in my dataframe, which was formerly
"date" and which I changed into "dates". Since my exporting worked (?).
The varTypes argument works as described...
2006 Mar 18
1
The R "fork"
Hello, I would like to call a function that can take infinite time to
be executed in some circumstances (which can not be easily detected).
So, I would like that once the function is being executed for more
than two seconds it is stopped. I have found documentation for timers
but i did not found how to "kill" a function. Moreover, I would like
not to change the function code (it should
2012 Aug 14
2
Not able to filter factor, class
...et the length as 225.
Can anyone help?
setwd("D:/AZ")
library("RODBC")
cdb_cnct <- odbcConnectExcel("AZIF_DC_GVK_NSCLC_MSALL_287papers_02072012_141450_v1_4.xls")
arm <- sqlFetch(cdb_cnct, "Arm")
inclusion <- sqlFetch(cdb_cnct, "Inclusion")
odbcClose(cdb_cnct)
rm(cdb_cnct)
names(inclusion)
[1] "Trial_Design_ID" "Reference_ID" "Inclusion_Criteria"
[4] "Value" "F5" "F6"
> class(inclusion$Value)
[1] "factor"
> nrow(inclusion)
[1] 4879...
2011 Aug 12
2
Getting data from an *.RData file into a data.frame object.
...created the *.RData file.
library(RODBC)
db <- odbcConnect("*******")
df <- sqlQuery(
db
, "select * from schema.table where year(someDate)=2006"
)
save(
df
, file="C:/Documents and Settings/userName/My Documents/table2006.RData"
)
dim(df)
remove(df)
odbcClose(db)
remove(db)
detach("package:RODBC")
Next, I moved that data file (table2006.RData) to another workstation - not
at the client site.
Now, I need to get that data file into a data.frame object. I know this
should be simple, but I can't seem to find out how to do that. I tried the...
2005 Nov 02
2
RODBC and Excel: Wrong Data Type Assumed on Import
The first column in my Excel sheet has mostly numbers but I need to treat it
as character data:
> library(RODBC)
> channel <- odbcConnectExcel("U:/efg/lab/R/Plasmid/construct list.xls")
> plasmid <- sqlFetch(channel,"Sheet1", as.is=TRUE)
> odbcClose(channel)
> names(plasmid)
[1] "Plasmid Number" "Plasmid" "Concentration" "Comments"
"Lost"
# How is the type decided? I need a character type.
> class(plasmid$"Plasmid Number")
[1] "numeric"
> typeof(plasmid$&...
2008 Jul 10
0
RODBC Close Memory Leak Question
Hi everyone,
In relation to the RODBC odbcClose bug which was fixed back in the
changelog below:
Version: 1.2-3 (2008-01-24, released)
* Plug a memory leak in inRODBCClose (closing a connection),
reported by Stephan Henne.
* Use translateChar() on character data sent in.
Background:
I am running some data from a SQL Server database, thr...