Skip to content
Prev 11758 / 15380 Next

[R-es] consulta por varTypes de sqlSave en RODBC

Hola Javier, si no estoy entendiendo mal, lo q deseo hacer no se trata de
configurar los parametros SQL, sino solo de colocar un vector en el
argumento VarTypes de la funcion sqlSave.

El manual especifica esa opcion, pero no da ningun ejemplo de como usarla.

*varTypes an optional named character vector giving the DBMSs datatypes to
be used for*
*some (or all) of the columns if a table is to be created.*

En este pdf
https://cran.r-project.org/web/packages/RODBC/vignettes/RODBC.pdf, solo se
hace referencia al argumento en este parrafo

*4.1 Data types when saving a data frame When sqlSave creates a table,
there is some choice as to the SQL data types used. The default is to
select the SQL data type from the R type via the typeInfo argument to
sqlSave. If this is not supplied (usual) a default mapping is looked up
using getSqlTypeInfo() or by interrogating sqlTypeInfo(). This will almost
always produce the correct mapping for numeric, integer and character
columns of up to 254 characters (or bytes). In other cases (include dates
and date-times) the desired SQL type can be specified for each column via
the argument varTypes, a named character vector with names corresponding to
(some of) the names in the data frame to be saved.*

Muchas gracias por tu ayuda y disculpa si no entiendi bien alguna de tus
preguntas.

Saludos

El 13 de julio de 2017, 10:39, Javier Marcuzzi <
javier.ruben.marcuzzi en gmail.com> escribió: