| query,RequeteDB-method | R Documentation |
query method loads a quert to the data and returns either an error or a data.frame
## S4 method for signature 'RequeteDB' query(object, ...)
object |
an object of class RequeteDB |
... |
further arguments passed to the query method, base will be passed to ConnectionDB to set the connection parameters, it should be a vector with dbname host port user and password (in this order) |
An object of class RequeteDB
assign("showmerequest",1,envir=envir_stacomi) allows to print all queries passing on the class RequeteDB
Cedric Briand cedric.briand@eptb-vilaine.fr
showClass("RequeteDB")
## Not run:
# this connection require user and password and a working data
object=new("RequeteDB",dbname ="bd_contmig_nat",
host ="localhost", port="5432", user ="postgres", password="secret")
)
object@open=TRUE
## this will leave the connection open,
## by default it closes after the query is sent
## the following will work only if you have configured and ODBC link
object@sql= "select * from t_lot_lot limit 100"
object<-query(object)
envir_stacomi=new.env()
## While testing if you want to see the output of sometimes
## complex queries generated by the program
assign("showmerequest",1,envir_stacomi)
## You can assign any values (here 1)
## just tests the existence of "showmerequest" in envir_stacomi
object@sql= "select * from mytable limit 100"
object<-connect(object)
## the connection is already closed, the query is printed
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.