dbExec                package:RMySQL                R Documentation

_E_x_e_c_u_t_e _a_n _S_Q_L _s_c_r_i_p_t _o_n _a _g_i_v_e_n _d_a_t_a_b_a_s_e _c_o_n_n_e_c_t_i_o_n

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

     Submits and executes an arbitrary SQL script (one or more
     statements) on a specific connection.

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

     dbExec(con, statement, ...)

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

     con: a connection object (i.e., an object that extends 
          `dbConnection'). 

statement: a character vector with one or more SQL statements. 

    ... : database-specific parameters may be specified. 

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

     This function submits and executes SQL scripts, i.e., one or  more
     SQL statements, to the database engine.  To fetch records you need
     to  use the function `fetch'. Currently it is undefined how
     multiple result sets are to be processed.

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

     an object that extends `dbResult', in the case of an SQL statement
     that produces no output (e.g., `INSERT'), or `dbResultSet' in the
     case of a  `SELECT'-like statement.

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

     The statements are submitted to the server connected through the
     connection `con.'

_B_u_g_s:

     Current implementations can only handle one-statement scripts.

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

     See the Omega Project for Statistical Computing at <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:

     mgr <- dbManger("MySQL")
     con <- dbConnect(mgr)
     rs <- dbExecStatement(con, "SELECT * from liv25")
     data <- fetch(rs, n = -1)

