sqlTypeInfo              package:RODBC              R Documentation

_R_e_q_u_e_s_t _I_n_f_o_r_m_a_t_i_o_n _a_b_o_u_t _D_a_t_a _T_y_p_e_s _i_n _a_n _O_D_B_C _D_a_t_a_b_a_s_e

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

     Request information about data types in an ODBC database

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

     sqlTypeInfo(channel, type = "all", errors = TRUE, as.is = TRUE)

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

 channel: connection handle as returned by 'odbcConnect'.

    type: The types of columns about which information is requested.
          Possible values are '"all"', '"char"', '"varchar"' ,
          '"wchar"', '"wvarchar"' (Unicode), '"real"', '"float"',
          '"double"', '"integer"', '"smallint"', '"date"', '"time"',
          '"timestamp"', '"binary"', '"varbinary"', '"longvarbinary"'
          and (its alias) '"blob"'. 

  errors: logical: if true halt and display error, else return '-1'.

   as.is: as in 'sqlGetResults'.

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

     'sqlTypeInfo' attempts to find the types of columns the database
     supports: ODBC drivers are not required to support this (but all
     known examples do).  Where it is supported, it is used by
     'sqlSave' to decide what column types to create when creating a
     new table in the database.

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

     A data frame on success, or character/numeric on error depending
     on the 'errors' argument.  Use 'sqlGetResults' for further details
     of errors.

     The columns returned may depend on the ODBC driver manager.  For a
     fully ODBC 3 manager, see <URL:
     http://msdn.microsoft.com/en-us/library/ms714632%28VS.85%29.aspx>:
     the symbolic constants mentioned there will be returned as numbers
     (and the values of the numeric constants can be found in the ODBC
     headers such as 'sql.h' and 'sqlext.h').

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

     Brian Ripley

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

     'sqlGetResults', 'odbcGetInfo'

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

     ## Not run: 
     > names(sqlTypeInfo(channel))
      [1] "TYPE_NAME"          "DATA_TYPE"          "COLUMN_SIZE"       
      [4] "LITERAL_PREFIX"     "LITERAL_SUFFIX"     "CREATE_PARAMS"     
      [7] "NULLABLE"           "CASE_SENSITIVE"     "SEARCHABLE"        
     [10] "UNSIGNED_ATTRIBUTE" "FIXED_PREC_SCALE"   "AUTO_UNIQUE_VALUE" 
     [13] "LOCAL_TYPE_NAME"    "MINIMUM_SCALE"      "MAXIMUM_SCALE"     
     [16] "SQL_DATATYPE"       "SQL_DATETIME_SUB"   "NUM_PREC_RADIX"    
     [19] "INTERVAL_PRECISION"
     ## End(Not run)

