[R] Rodbc retrieve data

Diaz Garcia, Luis Carlos Luis.Diaz at tecnocom.es
Wed Aug 19 14:11:14 CEST 2015


Hi every one
first I would like to introduce myself, as I'm new here.
I'm Luis from Barcelona, I'm Oracle dba and I need to create some nice
graphs.
So, I was looking for a solution and I saw R...

I think it's a good tool to make the task I need.

So here is the task: I need to get all the dblink from one database and draw
the result of the query.
The dblink will have the origin database name, the destination, the name of
the link the type too.
So I look into the R doc and I saw the way to get the data from my database:

library("RODBC")
con <- odbcConnect("DPL03", uid="myuser", pwd="mypass",believeNRows=FALSE )
dbName <- sqlQuery(con, "SELECT instance_name from v$instance",errors=FALSE)

Now I have dbName with one value, the name of my instance, but I don't know
how to insert this data into this:

plot.new()
title (main ="Map of the dbLinks of the database",sub="Luis Diaz -
Emergencies & improvments")


As you see, I create a screen to plot where I'll draw shapes and lines but
the first issue is to insert here the name of my instance, but I can't.
I try to concatenate like this:

title (main ="Mapa de los dblinks del entorno: " + dbName ,sub="Luis Diaz -
Emergencies & improvments")


But I have an error, and if I use print(dbName) the value is printed but
outside of the plot.new() screen.
Some one can help ?
Thanks in advance !

Cheers



More information about the R-help mailing list