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)

