dbReadTable-methods         package:RSQLite         R Documentation

_C_o_n_v_e_n_i_e_n_c_e _f_u_n_c_t_i_o_n_s _f_o_r _I_m_p_o_r_t_i_n_g/_E_x_p_o_r_t_i_n_g _D_B_M_S _t_a_b_l_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions mimic their R/S-Plus counterpart  `get', `assign',
     `exists',  `remove', and `objects', except that they generate code
     that gets remotely executed in a database engine.

_V_a_l_u_e:

     A data.frame in the case of `dbReadTable'; otherwise a logical 
     indicating whether the operation was successful.

_M_e_t_h_o_d_s:

     _c_o_n_n an `SQLiteConnection' database connection object.

     _n_a_m_e a character string specifying a table name.

     _v_a_l_u_e a data.frame (or coercible to data.frame).

     _r_o_w._n_a_m_e_s in the case of `dbReadTable', this argument can be a
          string or an index specifying the column in the DBMS table to
          be used as  `row.names' in the output data.frame (a `NULL',
          `""', or 0  specifies that no column should be used as
          `row.names' in the output).

          In the case of `dbWriteTable', this argument should be a
          logical specifying whether the `row.names' should be output
          to the output DBMS table; if `TRUE', an extra field whose
          name will be  whatever the R/S-Plus identifier `"row.names"'
          maps to the DBMS (see `make.db.names').

     _o_v_e_r_w_r_i_t_e a logical specifying whether to overwrite an existing
          table or not.  Its default is `FALSE'.

     _a_p_p_e_n_d a logical specifying whether to append to an existing table
          in the DBMS.  Its default is `FALSE'.

     ...  any optional arguments.

_N_o_t_e:

     Note that the data.frame returned by `dbReadTable' only has
     primitive data, e.g., it does not coerce character data to
     factors.

     SQLite table names are not case sensitive, e.g., table names `ABC'
     and `abc' are considered equal.

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

     `SQLite', `dbDriver', `dbConnect', `dbSendQuery', `dbGetQuery',
     `fetch', `dbCommit', `dbGetInfo', `dbListTables', `dbReadTable'.

_E_x_a_m_p_l_e_s:

     conn <- dbConnect("SQLite", dbname = "sqlite.db")
     if(dbExistsTable(con, "fuel_frame")){
        dbRemoveTable(conn, "fuel_frame")
        dbWriteTable(conn, "fuel_frame", fuel.frame)
     }
     if(dbExistsTable(conn, "RESULTS")){
        dbWriteTable(conn, "RESULTS", results2000, append = T)
     else
        dbWriteTable(conn, "RESULTS", results2000)
     }

