OraPreparedStatement-class      package:ROracle      R Documentation

_O_r_a_c_l_e _P_r_e_p_a_r_e_d _S_t_a_t_e_m_e_n_t

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

     A class that encapsulates the information on an Oracle prepared
     statement

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Use the method 'dbPrepareStatement' to create an Oracle  prepared
     statement and 'dbExecStatement' to re-bind new  data and execute
     the cached statement.

_S_l_o_t_s:

     '_I_d': an opaque reference into the prepared statement.

_E_x_t_e_n_d_s:

     Class '"DBIPreparedStatement"', directly. Class '"OraResult"',
     directly. Class '"DBIObject"', by class "DBIPreparedStatement".
     Class '"DBIResult"', by class "OraResult". Class '"OraObject"', by
     class "OraResult". Class '"dbObjectId"', by class "OraResult".

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

     _d_b_E_x_e_c_S_t_a_t_e_m_e_n_t 'signature(ps = "OraPreparedStatement", data =
          "data.frame")':  executes a prepared statement re-binding new
          data to it.

     _d_b_G_e_t_I_n_f_o 'signature(dbObj = "OraPreparedStatement")':  returns a
          list of metadata associated with the prepared statement.

     _s_u_m_m_a_r_y 'signature(object = "OraPreparedStatement")':  writes a
          brief summary of the status of the prepared statement. 

_B_a_c_k_g_r_o_u_n_d:

     Oracle's prepared statements (like other RDBMS') are SQL
     statements that are parsed and cached to increase performance 
     when the SQL code is to be executed repeatedly but with different
     data; for instance when inserting the rows of a 'data.frame' into
     a table the SQL for each row is exactly the same, only the row
     data changes.

     The function 'dbPrepareStatement' creates objects that extend the
     base class 'DBIPreparedStatement'. These objects are simple
     references into C structures that store the various aspects (the
     text of the SQL statement, sets of buffers for transferring data
     back and forth, etc).

     The function 'dbExecStatement' takes a prepared statement object
     and a 'data.frame' and binds one or more of its columns to the
     RDBMS table or object according to the specification in the
     prepared statement.

_N_o_t_e:

     As of the DBI version 0.1-5 prepared statements are not part  of
     the R/S Database Interface definition (DBI).

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

     DBI classes: 'OraObject-class' 'OraDriver-class'
     'OraConnection-class' 'OraResult-class'
     'OraPreparedStatement-class'

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

     ## Not run: 
       ora <- dbDriver("Oracle")
       con <- dbconnect(ora, "user/password")
       ps <- dbPrepareStatement(con, 
                "INSERT into QUAKES (lat, long_1) VALUES (:1, :2)",
                bind = c("numeric", "numeric"))
       dbExecStatement(ps, quakes)
       dbCommit(con)
     ## End(Not run)

