0

I am trying to write an R data frame to a table in a db2 data base. Does anyone know what additional argument I supply to the function dbWriteTable in order to specify the field types of the columns?

I found this similar question: RMySQL dbWriteTable with field.types, however, the solution doesn't seem to hold for db2.

Cheers

Community
  • 1
  • 1
user32259
  • 1,113
  • 3
  • 13
  • 21

1 Answers1

1

You can't supply fields types using dbWriteTable. JDBC is designed to hold many data bases, so it has a minimal data types mapping :

   integer --> INTEGER
   numeric --> DOUBLE PRECISION
   else    --> VARCHAR(255)

You should create you table using some sql request.

agstudy
  • 119,832
  • 17
  • 199
  • 261