Run database queries using dbSendQuery, fetch and dbClearResult in similar fashion as dbGetQuery but provide better error handling.
This function always returns a data.frame as opposed to different types in case of an exception. However, if the database query fails and empty data.frame is returned. Besides query status and database error are returned as attributes. Make sure to use BEGIN and COMMIT outside of these statements.
# NOT RUN {# There's no connection, so this returns a proper error message.# }# NOT RUN {out_obj <- runDbQuery(bogus_connection,"SELECT * FROM some_table")
attributes(out_obj)
# }