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

Denis Mukhin den|@@x@mukh|n @end|ng |rom or@c|e@com
Thu Sep 4 16:28:31 CEST 2014


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() ...

Denis

-----Original Message-----
From: Hadley Wickham [mailto:hadley using rstudio.com] 
Sent: Thursday, September 04, 2014 9:13 AM
To: MacQueen, Don
Cc: Simon Urbanek; R-sig-DB using r-project.org
Subject: Re: [R-sig-DB] Add a "dbSendUpdate" function to DBI?

A thought: should dbSendUpdate() return a boolean indicating success, or always return TRUE, otherwise throwing an error?

Hadley

On Wed, Sep 3, 2014 at 3:59 PM, MacQueen, Don <macqueen1 using llnl.gov> wrote:
> Hadley,
>
> Since you mentioned DBI 0.3 in a recent email, could I make a request 
> to add a dbSendUpdate() function to DBI, like the one in RJDBC?
>
> require(RJDBC)
>
>> find('dbSendQuery')
> [1] "package:RJDBC" "package:DBI"
>
>> find('dbSendUpdate')
> [1] "package:RJDBC"
>
> And from ?dbSendUpdate
>
>   'dbSendQuery' and 'dbSendUpdate' submit a SQL query to the
>   database. The difference between the two is only that
>   'dbSendUpdate' is used with DBML queries and thus doesn't return
>   any result set.
>
> I would find this helpful, because I could then use scripts unmodified 
> with either ROracle or RJDBC.
> (I suppose adding it to DBI would mean that the one in RJDBC would 
> have to be modified.)
>
>
> I have:
>
> Package Version
>   "DBI" "0.3.0"
>
> Package Version
> "RJDBC" "0.2-4"
>
>
> Thanks
> -Don
>
> --
> Don MacQueen
> Lawrence Livermore National Laboratory
> 7000 East Ave., L-627
> Livermore, CA 94550
> 925-423-1062
>



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

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group R-sig-DB using r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-db




More information about the R-sig-DB mailing list