dbCommit-methods             package:DBI             R Documentation

_D_B_M_S _T_r_a_n_s_a_c_t_i_o_n _M_a_n_a_g_e_m_e_n_t

_D_e_s_c_r_i_p_t_i_o_n:

     Commit/rollback SQL transactions

_U_s_a_g_e:

       dbCommit(conn, ...)
       dbRollback(conn, ...)

_A_r_g_u_m_e_n_t_s:

    conn: a 'DBIConnection' object, as produced by the function 
          'dbConnect'. 

    ... : any database-specific arguments. 

_D_e_t_a_i_l_s:

     Not all database engines implement transaction management, older
     versions of MySQL, for instance.

_V_a_l_u_e:

     a logical indicating whether the operation succeeded or not.

_S_i_d_e _E_f_f_e_c_t_s:

     The current transaction on the connections 'con' is committed or
     rolled back.

_R_e_f_e_r_e_n_c_e_s:

     See the Database Interface definition document 'DBI.pdf' in the
     base directory of this package or <URL:
     http://developer.r-project.org/db>.

_S_e_e _A_l_s_o:

     'dbConnect' 'dbSendQuery' 'dbGetQuery' 'fetch' 'dbCommit'
     'dbGetInfo' 'dbReadTable'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     ora <- dbDriver("Oracle")
     con <- dbConnect(ora)
     rs <- dbSendQuery(con, 
           "delete * from PURGE as p where p.wavelength<0.03")
     if(dbGetInfo(rs, what = "rowsAffected") > 250){
       warning("dubious deletion -- rolling back transaction")
       dbRollback(con)
     }
     ## End(Not run)

