Skip to content
Back to formatted view

Raw Message

Message-ID: <CAP01uRmX3u+-GUT=vgwHg+Ab0TsCLqxoiQ2EVqqRfLsu76HSrQ@mail.gmail.com>
Date: 2011-11-09T00:36:38Z
From: Gabor Grothendieck
Subject: dbWriteTable with field data type
In-Reply-To: <CAG2PC+dR9WNg9FOVq+qHTev0P5pHfd0pJKM-ZQhiA-7VaUSq_A@mail.gmail.com>

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