RODBC                 package:RODBC                 R Documentation

_O_D_B_C _D_a_t_a_b_a_s_e _C_o_n_n_e_c_t_i_v_i_t_y

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

     `RODBC' implements ODBC database connectivity with compliant
     databases where drivers exist on the host system.

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

     sqlCopy(channel, query, destination, destchannel = channel, verbose = FALSE,
             errors = TRUE, ...)
     sqlCopyTable(channel, srctable, desttable, destchannel = channel,
                  verbose = FALSE, errors = TRUE)

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

channel, destchannel: connection handle as returned by `odbcConnect'.

   query: any valid SQL statement

destination, srctable, desttable: a database table name accessible from
          the connected dsn.  This should be either a character string
          or a character vector of length 1.

 verbose: Display statements as they are sent to the server?

  errors: if TRUE halt and display error, else return -1.

     ...: additional arguments to be passed to `sqlSave'.

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

     Two groups of commands are provided.  `odbc*' commands implement
     relatively low level access to the odbc functions of similar name.
     `sql*' commands are higher level constructs to read, save, copy
     and manipulate data between data frames and sql tables.  Up to 16
     connections can be open at once to any combination of dsn/hosts.
     Writing columns is limited to 255 characters wide.

     `sqlCopy' as is like `sqlQuery', but saves the output of `query'
     in table `destination' on channel `destchannel'. [Not yet
     implemented.]

     `sqlCopyTable' copies the structure of `srctable' to `desttable'
     on dsn `destchannel'.  This is within the limitations of the ODBC
     lowest common denominator.  More precise control is possible via
     `sqlQuery'.

     A few functions try to cope with the peculiar way the Excel ODBC
     driver handles names.

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

     See `sqlGetResults'.

_A_u_t_h_o_r(_s):

     Michael Lapsley and Brian Ripley

_S_e_e _A_l_s_o:

     `odbcConnect', `sqlFetch', `sqlSave', `sqlTables', `odbcGetInfo'

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

     library(RODBC)
     data(USArrests)
     channel <- odbcConnect("test", "", "") # userId and password
     sqlSave(channel, USArrests, rownames = "State", verbose = TRUE)
     options(dec=".") # this is the default decimal point
     sqlQuery(channel, "select State, Murder from USArrests where rape > 30 order by Murder")
     sqlFetch(channel, "USArrests", rownames = "State")
     sqlDrop(channel, "USArrests")
     odbcClose(channel)

