View Feed
group-icon
Databases
Discuss databases and writing database queries with fellow DB enthusiasts.
296 Members
Join this group to post and comment.
rohitvishnu
rohitvishnu • Apr 18, 2009

importing dbf files into mysql

hi guys.

i have an xls sheet in openoffice.org. i'm workin on a small project and i need to convert this sheet into a mysql database. i see that openoffice allows me to save the spreadsheet as a .dbf file. does mysql support direct importing of fields from the .dbf file into a mysql database? if so whats the procedure?

i currently have the gui tools for mysql. are there any other packages i have to download for this?

thanks in advance.
slashfear
slashfear • Apr 20, 2009
Hi Rohit,

You can use Load data as shown below,


LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE '[I]file_name[/I]'
    [REPLACE | IGNORE]
    INTO TABLE [I]tbl_name[/I]
    [CHARACTER SET [I]charset_name[/I]]
    [{FIELDS | COLUMNS}
        [TERMINATED BY '[I]string[/I]']
        [[OPTIONALLY] ENCLOSED BY '[I]char[/I]']
        [ESCAPED BY '[I]char[/I]']
    ]
    [LINES
        [STARTING BY '[I]string[/I]']
        [TERMINATED BY '[I]string[/I]']
    ]
    [IGNORE [I]number[/I] LINES]
    [([I]col_name_or_user_var[/I],...)]
    [SET [I]col_name[/I] = [I]expr[/I],...]
For further help or reference you can visit the following link ( which can give you the clear picture of how to do that process) :

MySQL :: MySQL 5.1 Reference Manual :: 12.2.6 LOAD DATA INFILE Syntax

Hope the information was useful for you!!!!😁

Share this content on your social channels -