commit                package:RMySQL                R Documentation

_R_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:

     commit(con, ...)

     rollback(con, ...)

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

     con: a `dbConnection' 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, MySQL,
     for instance.

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

     NULL

_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 Omega Project for Statistical Computing (<URL:
     http://www.omegahat.org>) for more details on the R/S database
     interface.

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

     On database managers:

     `dbManager' `MySQL' `load' `unload'

     On connections, SQL statements and resultSets:

     `dbExecStatement' `dbExec' `fetch' `quickSQL'

     On transaction management:

     `commit' `rollback'

     On meta-data:

     `describe' `getVersion' `getDatabases' `getTables' `getFields'
     `getCurrentDatabase' `getTableIndices' `getException'
     `getStatement' `hasCompleted' `getRowCount' `getAffectedRows'
     `getNullOk' `getInfo'

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

     ora <- Oracle()
     con <- dbConnect(ora)
     rs <- dbExecStatement(con, 
           "delete * from PURGE as p where p.wavelength<0.03")
     if(rowsAffected(rs) > 250){
       warning("dubious deletion -- rolling back transaction")
       rollback(con)
     }

