Luis Ridao | 7 Sep 15:26 2012
Picon

RODBC connection linux (ubuntu)

HI,

i think this problem has come up pretty often on this and other lists
and still have not managed to solved it.

i need to connect to a an Oracle database through R.

I have installed the oracle install client and the package RODBC in R
but still get the same error:

[RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data
source name not found, and no default driver specified
2: In odbcDriverConnect("DSN=MAGNUS;UID=my_uid;PWD=my_pwd") :
  ODBC connection failed

/etc/odbc.ini looks like:

odbc.ini
---------------------------------------
[ORACLE_SAMPLE]
driver = Easysoft ODBC-Oracle WP
description = Easysoft Oracle ODBC WP driver
server = oserver
port = 1521
sid = 192.168.20.129/MAGNUS
user = luisr
password =my_pwd
logging = No
logfile =
enable_user_catalog = yes
(Continue reading)

Kate Dresh | 25 Aug 01:10 2012
Picon

data frame remove column

*Hi all,*

I'm trying to filter a file through the columns. This file below is a
example of my data frame. My true data frame has seven hundred thousand
columns and 500 hundred lines. I need to identify and to remove all columns
that all elements equal a number 1. In this my case, columns were deleted
are number 1,5 and 10.

file <-read.table(text="

1  0  2  2  1  1  5  1  1  1

1  0  2  2  1  1  5  1  1  1

1  0  2  2  1  2  5  2  2  1

1  0  2  2  1 1  5  1  1  1

1  0 2  2   1  0  5  0  2  1

1  0  2 2   1  1  5  1  0  1

",sep="",header=FALSE)

the result after the filter will be

0  2  2  1  5  1  1

 0  2  2  1  5  1  1

(Continue reading)

julien cuisinier | 25 Jun 13:46 2012
Picon

FW: Connect R to MySQL DB installed via XAMPP


Hi List,

On windows XP & R2.15. Session info below. 

I installed XAMPP on my machine - I can't install MYSQL on the C:\Program file dir because no admin rights, so
I installed XAMPP onto a personal directory...which I guess makes things slightly harder, but I am
hopeful I am not thhe first one struggling on this!

Any feedback  redirection / hints hugely appreciated

(1) I tried to install RMySQL which I used successsfully on Linux in the past but it seems to be a trouble on
Windows, no binary available on CRAN (anymore?) & when trying the "type = 'source' " option I get the
following: 

> install.packages("RMySQL",type="source")
trying URL 'http://cran.ma.imperial.ac.uk/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb

'\\UKLonHome.HDS.Int\Home$\julien.cuisinier'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
ERROR: configuration failed for package 'RMySQL'
* removing 'P:/PersoServer/Programs/R/R-2.15.0/library/RMySQL'

The downloaded source packages are in
(Continue reading)

Jim Jones | 17 Jun 11:59 2012
Picon

Database R Package

Gentlemen,

Last winter at university in the R Programming course I developed an R
Package (so far called rdba) for dealing with some DBA tasks from R
scripts. The package basically avoids the need of the user to have
knowledge of database (PostgreSQL + PostGIS) scripts to manage their
databases. It aims to facilitate the scripts development when "on the fly"
you need to handle databases and tablespaces in a physical level.

The package contains the following functions:

Create Database (With or without a template)
Drop Databse
List Database
Database Exists

Create Tablespace
Drop Tablespace
List Tablespace
Rename Tablespace
Tablespace Exists
Change Owner Tablespace

ListUsers
UserExists

I would like to hear your opinion about submitting it to CRAN, since I'm
new in the list and you are the experts. Initially I just wrote the
functions for PostgreSQL, but it is already in my plans to extend it to
Oracle and SQL Server. What do you think?
(Continue reading)

Slawin, Scott | 7 Jun 15:52 2012

Using LDAP connection

Hello,

I am trying to find an R package that will allow me to connect to Oracle
using LDAP.  Can someone help direct me to such a package or
documentation.  

RCURL does mention LDAP, but is not very specific on how to use LDAP
with sql statements.

Thanks in advance.

Scott Slawin
AFT-Business Intelligence Delivery (BID) Team
Allstate Insurance Company
3100 Sanders Road, Suite J3
Northbrook, IL 60062 
Phone 847-402-3649 
sslaw@...
<mailto:emailname@...>  

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

Idit Buch | 3 Jun 14:04 2012

calloc error issued by sqlQuery

Hi,

I'm using R version 2.14.1 on Linux (Centos) and trying to issue a "select * from ..." query using sqlQuery(...).
I then receive the following error:
Error in odbcQuery(channel, query, rows_at_time) :
  Calloc could not allocate memory (18446744073709551616 of 22816 bytes)

The function odbcGetInfo(channel) returns the following:

                  DBMS_Name                    DBMS_Ver
     "Microsoft SQL Server"                "09.00.4035"
            Driver_ODBC_Ver            Data_Source_Name
                    "03.52"                       "DSN"
                Driver_Name                  Driver_Ver
"libsqlncli-11.0.so.1790.0"                "11.00.1790"
                   ODBC_Ver                 Server_Name
                    "03.52"                    "RGNSQL"

The function sessionInfo() returns the following:
R version 2.14.1 (2011-12-22)
Platform: x86_64-redhat-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C                 LC_NAME=C
[9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

(Continue reading)

RODBC sqlSave to table with computed column.

Hello. I would like to append records to a sql server table with a computed column. The computed column is the
product of two other columns in the same table. In my first attempt I used a dataframe with all of the columns
populated less the computed column, but I received and error

Submitted:
sqlSave(riskDB, optHedgesFiltered, tablename = "OptHedges", append = TRUE, verbose=TRUE, rownames=FALSE)

ERROR:
Query: INSERT INTO "OptHedges" ( "Book", "DealTicket", "TransactionDate", "ForwardDate",
"Location", "DemandProfile", "Volume", "Price", "Contract" ) VALUES ( ?,?,?,?,?,?,?,? )
Error in odbcUpdate(channel, query, mydata, coldata[m, ], test = test,  : 
  missing columns in 'data'

If I change the dataframe to include contract (the computed column) the ERROR changes to:

sqlwrite returned 
[RODBC] Failed exec in Update
42000 271 [Microsoft][ODBC SQL Server Driver][SQL Server]The column "Contract" cannot be modified
because it is either a computed column or is the result of a UNION operator.

Am I missing something in the sqlSave to deal with the computed column? As a test to make sure that I could
append at all, I created a copy of the table I am trying to append to on the server and removed the computed
column. The sqlSave statement above worked perfectly on the copy without the computed column.

Any direction is appreciated.

Thanks,
Mikael

_______________________________________________
(Continue reading)

Paul Gilbert | 28 May 15:01 2012
Picon

Re: SOS! R Console crashed after loading RODBC... Update: Re: How to set up RODBC? Diff between R Console and RStudio?

I think it would be useful to first understand how your RStudio 
environment is working. You should not need both "/pp64/odbc/5.3/lib" 
and "/pp64/odbc/5.1/lib" on your LD_LIBRARY_PATH. One can guess what is 
being used, but it would be better to be certain. So if you can get a 
relatively clean RStudio environment that works, then deciding what to 
use in the console session would be easier.

Once again, while the crash to the shell with no error messages may not 
happen until you execute some R commands, this behaviour is almost 
certainly related to loading a bad binary file or library.

(Also, be certain you are getting the same version of R and package 
libraries when you run RStudio and your console session.)

Paul

On 12-05-27 09:59 PM, Michael wrote:
> Even more weirdly...
> Now I open the R-Console again, and manually typed:
>
>  >
>
> library(RODBC)
>
>  >
>
> require(RODBC)
>
> And it seems to be fine, no crash at all.
> But when I run my original program(the same program ran perfectly fine
(Continue reading)

Paul Gilbert | 28 May 02:37 2012
Picon

Re: SOS! R Console crashed after loading RODBC... Update: Re: How to set up RODBC? Diff between R Console and RStudio?

If they are both installed, I think they are in directories like 
/usr/lib/i386-linux-gnu/ and /usr/lib/x86_64-linux-gnu/. If they are not 
both installed, then that could not be the problem. Try
   locate libodbc.so
to see what you have installed.

On 12-05-27 07:58 PM, Michael wrote:
> Thank you Paul.
> How do I judge/check which lib is 32 and which is 64?
> Thanks again!
>
> On Sun, May 27, 2012 at 6:45 PM, Paul Gilbert <pgilbert902@...
> <mailto:pgilbert902@...>> wrote:
>
>     (Cross posting should not be done!)
>
>     A crash to the shell prompt suggests a bad .so got loaded. Maybe you
>     are picking up a 32 bit version instead of 64 bit, or the reverse. I
>     am surprised you need to set  LD_LIBRARY_PATH, and if you set it
>     wrong it might cause this. (Just guessing.)
>
>     Paul
>
>
>
>     On 12-05-27 01:26 PM, Michael wrote:
>
>         On Sun, May 27, 2012 at 11:32 AM, Michael<comtech.usa@...
>         <mailto:comtech.usa@...>>  wrote:
>
(Continue reading)

Michael | 27 May 18:32 2012
Picon

SOS! R Console crashed after loading RODBC... Update: Re: How to set up RODBC? Diff between R Console and RStudio?

Help! The R Console very quietly closed and exited without giving any
errors/warnings...after I loaded the RODBC library...

Loading required package: RODBC

On Sat, May 26, 2012 at 10:27 PM, Michael <comtech.usa@...> wrote:

> Hi all,
>
> It's very strange. In RStudio, I can successfully load("RODBC"). But in
> the plain R Console, I just couldn't get it work:
>
> (For some special and important reasons, I have to make the RODBC work in
> R Console, not the RStudio.)
>
> At first, the some shared library "libodbc.so" couldn't be found... it's
> right there, but R Console just couldn't find it.
>
> I then find that the
>
> Sys.getenv("LD_LIBRARY_PATH") is different for R Console vs. RStudio.
>
> Weirdly, the LD_LIBRARY_PATH in RStudio even doesn't have any "ODBC"
> terms/words in its long string...
>
> I guess RStudio has some special configuration for RODBC, so it doesn't
> require LD_LIBRARY_PATH to be set up for ODBC at all.
>
> I then added the ODBC library path into the LD_LIBRARY_PATH in R Console.
>
(Continue reading)

Michael | 27 May 05:27 2012
Picon

How to set up RODBC? Diff between R Console and RStudio?

Hi all,

It's very strange. In RStudio, I can successfully load("RODBC"). But in the
plain R Console, I just couldn't get it work:

(For some special and important reasons, I have to make the RODBC work in R
Console, not the RStudio.)

At first, the some shared library "libodbc.so" couldn't be found... it's
right there, but R Console just couldn't find it.

I then find that the

Sys.getenv("LD_LIBRARY_PATH") is different for R Console vs. RStudio.

Weirdly, the LD_LIBRARY_PATH in RStudio even doesn't have any "ODBC"
terms/words in its long string...

I guess RStudio has some special configuration for RODBC, so it doesn't
require LD_LIBRARY_PATH to be set up for ODBC at all.

I then added the ODBC library path into the LD_LIBRARY_PATH in R Console.

I found that this problem is solved...

But then the R Console complained that the "ODBCINI" was set up correctly.

So I compared the "ODBCINI" in RStudio vs. "ODBCINI" in R Console, found
the R Console one seems to be missing.

(Continue reading)


Gmane