dbCommit-methods           package:RMySQL           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:

     Commits or roll backs the current transaction  in an MySQL
     connection

_M_e_t_h_o_d_s:

     _c_o_n_n a 'MySQLConnection' object, as produced by the function 
          'dbConnect'.

     ...  currently unused.

_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://stat.bell-labs.com/RS-DBI>.

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

     'MySQL', 'dbConnect', 'dbSendQuery', 'dbGetQuery', 'fetch',
     'dbCommit', 'dbGetInfo', 'dbReadTable'.

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

     ## Not run: 
     drv <- dbDriver("MySQL")
     con <- dbConnect(drv, group = "group")
     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)

