[R] dbWriteTable with field data type

Gabor Grothendieck ggrothendieck at gmail.com
Wed Nov 9 01:36:38 CET 2011


On Tue, Nov 8, 2011 at 12:16 PM, Ben quant <ccquant at gmail.com> wrote:
> Hello,
>
> When I do:
>
> dbWriteTable(con, "r.BOD", cbind(row_names = rownames(BOD), BOD))
>
> ...can I specify the data types such as varchar(12), float, double
> precision, etc. for each of the fields/columns?
>
> If not, what is the best way to create a table with specified field data
> types (with the RpgSQL package/R)?
>

dbWriteTable will set types based on the input data.frame classes but
if you don't like them then you can use the sql create table statement
to define a table layout and then use insert statements to insert the
data.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list