[R-sig-DB] Add a "dbSendUpdate" function to DBI?

Hadley Wickham h@d|ey @end|ng |rom r@tud|o@com
Fri Sep 5 13:36:45 CEST 2014


On Thu, Sep 4, 2014 at 8:05 PM, Simon Urbanek
<simon.urbanek using r-project.org> wrote:
> On Sep 4, 2014, at 10:54 AM, Hadley Wickham <hadley using rstudio.com> wrote:
>
>> On Thu, Sep 4, 2014 at 9:28 AM, Denis Mukhin <denis.x.mukhin using oracle.com> wrote:
>>> In ROracle we standardized on the second approach, namely always return TRUE, otherwise throw an error.
>>>
>>> Also since UPDATE is not the only operation that does not return any results (although it might with a RETURNING clause) would a more generic name be more appropriate here? Besides DMLs there are also DDLs. Something like dbExecute(), dbSubmit(), dbSend() ...
>>
>> How about dbExecuteQuery() ?
>
> I wouldn't call it "query" since that implies results... sort of the opposite of what it does.

Hmmm, that's true in regular English, but it is the structured *query*
language, and I think it's common for people to talk about delete
queries, updates queries etc.

> FWIW the "update" in dbSendUpdate has nothing to do with the "UPDATE" SQL statement - the intention was to convey the notion that there is no result - at least in my mind "an update" is a push action where as "a query" is a pull-action. But I'll certainly yield to native English speakers here ;).

dbSendUpdate doesn't feel quite right to me either - you can send
things that are not updates (e.g. dbSendUpdate(con, "ROLLBACK")).

What about dbExecuteStatement() ?

Hadley

-- 
http://had.co.nz/




More information about the R-sig-DB mailing list