dbEscapeStrings-methods        package:RMySQL        R Documentation

_E_s_c_a_p_e _a _C_h_a_r_a_c_t_e_r _V_e_c_t_o_r _A_c_c_o_r_d_i_n_g _t_o _S_Q_L _r_u_l_e_s

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

     Escape SQL-special characters in a character vector according to
     MySQL rules.

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


     _c_o_n = "_M_y_S_Q_L_C_o_n_n_e_c_t_i_o_n", _s_t_r_i_n_g_s = "_c_h_a_r_a_c_t_e_r" This method encodes
          the 'strings' character vector according to the MySQL escape
          rules and taking into consideration the character set used by
          the connection (each MySQL connection may be set to use
          different character sets).  Note that the 'RMySQL' package
          currently does not deal with character set conversions - it
          uses whatever character encoding the R session is using, but
          the MySQL runtime library handles this transparently.

     ... currently unused.

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

     'MySQL', 'dbConnect', 'dbSendQuery', 'dbGetQuery', 'fetch',
     'dbNextResult', 'dbCommit', 'dbGetInfo', 'dbReadTable'.

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

     ## Not run: 
     con <- dbConnect(MySQL(), 
               dbname = "rs-dbi", 
               client.flag=CLIENT\_MULTI\_STATEMENTS)
     tmp <- sprintf("select * from emp where lname = 
     sql <- dbEscapeString(con, tmp)
     dbGetQuery(con, sql)
     ## End(Not run)

