dbConnect-methods          package:RSQLite          R Documentation

_C_r_e_a_t_e _a _c_o_n_n_e_c_t_i_o_n _o_b_j_e_c_t _t_o _a_n _S_Q_L_i_t_e _D_B_M_S

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

     These methods are straight-forward implementations of the
     corresponding generic functions.

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

     _d_r_v an object of class `SQLiteDriver', or the character string
          "SQLite" or an `SQLiteConnection'.

     _c_o_n_n an `SQLiteConnection' object as produced by `dbConnect'.

     ...  In the case of SQLite all you need is `dbname', which should
          refer to a file name.

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

     A connection between R/S-Plus and the embeddable SQLite server is 
     established.  Note that since the SQLite is embedded in R/S-Plus,
     connections are not too resource hungry.

     SQLite connections only require the file name where the SQLite
     database reside.  For details see `SQLite'.

_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', `dbConnect', `dbSendQuery', `dbGetQuery', `fetch',
     `dbCommit', `dbGetInfo', `dbReadTable'.

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

     # create an SQLite instance and create one connection.
     drv <- dbDriver("SQLite")

     # open the connection using user, passsword, etc., as
     con <- dbConnect(drv, dbname = "sqlite.db")

     # Run an SQL statement by creating first a resultSet object
     rs <- dbSendQuery(con, statement = paste(
                           "SELECT w.laser_id, w.wavelength, p.cut_off",
                           "FROM WL w, PURGE P", 
                           "WHERE w.laser_id = p.laser_id", 
                           "SORT BY w.laser_id")
     # we now fetch records from the resultSet into a data.frame
     data <- fetch(rs, n = -1)   # extract all rows
     dim(data)

