[R] Rodbc retrieve data
Mark Sharp
msharp at txbiomed.org
Wed Aug 19 17:54:53 CEST 2015
Diaz,
paste() and paste0() will work here. paste0() defaults to "" between character vector elements and paste() defaults to " " (single blank character) between character vector elements. See ?paste.
I do not recall, but you may have to escape the "&" symbol, but that is another topic.
Try this.
title (main = paste0("Mapa de los dblinks del entorno: ", dbName),sub="Luis Diaz -
Emergencies & improvments")
Mark
P.S. Spelling correction - "improvements"
R. Mark Sharp, Ph.D.
Director of Primate Records Database
Southwest National Primate Research Center
Texas Biomedical Research Institute
P.O. Box 760549
San Antonio, TX 78245-0549
Telephone: (210)258-9476
e-mail: msharp at TxBiomed.org
> On Aug 19, 2015, at 7:11 AM, Diaz Garcia, Luis Carlos <Luis.Diaz at tecnocom.es> wrote:
>
> 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
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list