[R] Package for converting R datasets into SQL Server (create table and insert statements)?

johannes rara johannesraja at gmail.com
Sat Oct 9 17:08:05 CEST 2010


Thanks Michael! dbBuildTableDefinition is something I was looking for
but it does not seem to support SQL Server table definitions (CREATE
TABLE statements may vary between different RDBMS).

Thanks anyway,
-J



2010/10/9 Michael Bedward <michael.bedward at gmail.com>:
> Package RSQLite has a dbBuildTableDefinition that creates the CREATE
> TABLE statement for a given a data.frame. I think other db related
> packages for MySQL and PostgreSQL also have such a function.
>
> Michael
>
>
> On 10 October 2010 00:39, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
>> On Sat, Oct 9, 2010 at 9:02 AM, johannes rara <johannesraja at gmail.com> wrote:
>>> Thanks, but I'm not looking for a function to save dataframes into a
>>> RDBMS. I'm looking for a function which creates CREATE TABLE and
>>> INSERT statements from a dataframe.
>>>
>>
>> If the reason you want that is so you can manipulate R data frames in
>> SQL then the sqldf package does that.  There are no create statements
>> to issue and no insert statements to issue (although you can).  The
>> database is automatically created, the create and insert statements
>> are automatically generated and executed, your SQL statement is run,
>> the result is automatically retrieved and the database is
>> automatically destroyed afterwards.  You just specify a select or
>> other sql statement with the data frame name(s) replacing the table
>> name(s).  It works with built-in data frames that ship with R and with
>> data frames you create yourself.  See http://sqldf.googlecode.com for
>> more.
>>
>> --
>> Statistics & Software Consulting
>> GKX Group, GKX Associates Inc.
>> tel: 1-877-GKX-GROUP
>> email: ggrothendieck at gmail.com
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>



More information about the R-help mailing list