Execute queries {RPgSQL} | R Documentation |
db.execute
sends a query to the database back end for
processing.
db.result.status
returns a result code indicating the status of
the result buffer.
db.clear.result
frees the result buffer.
db.toggle.echo
toggles between echo'ing all communication with
the back end.
db.execute(..., clear=T, report.errors=T) db.result.status() db.clear.result() db.toggle.echo()
... |
A character string containing any valid command or query to be sent to the PostgreSQL back end. |
clear |
If true, free any resources allocated by db.execute() immediately on returning. |
report.errors |
If true, report fatal and non-fatal errors |
See the file "libpq-fe.h" in your PostgreSQL distribution for a listing of error codes.
Timothy H. Keitt
if (db.connection.open()) { db.execute("select * from pg_user", clear=F) db.result.status() for (i in 1:db.result.rows()) cat(db.result.get.value(row=i), "\n") db.clear.result() }