Import data from excel to database
Moderator: General Moderators
Import data from excel to database
Is it impossible to import excel data to database's table? I know that it can be done by using MySQL command LOAD DATA INFILE 'path/file.txt' INTO TABLE your_table; , but how the data match with the table field? Is it necessary to declare it first?
Re: Import data from excel to database
It is definitely possible. You have the correct command. And you're correct, you have to know what data is in the spreadsheet and insure that you have an existing table with the appropriate fields. Even then, there are often difficulties if the spreadsheet contains formulas or headers, etc.rei27 wrote:Is it impossible to import excel data to database's table? I know that it can be done by using MySQL command LOAD DATA INFILE 'path/file.txt' INTO TABLE your_table; , but how the data match with the table field? Is it necessary to declare it first?
Re: Import data from excel to database
califdon wrote:It is definitely possible. You have the correct command. And you're correct, you have to know what data is in the spreadsheet and insure that you have an existing table with the appropriate fields. Even then, there are often difficulties if the spreadsheet contains formulas or headers, etc.rei27 wrote:Is it impossible to import excel data to database's table? I know that it can be done by using MySQL command LOAD DATA INFILE 'path/file.txt' INTO TABLE your_table; , but how the data match with the table field? Is it necessary to declare it first?
That's means i must create the same table and fields for both excel and database. And the make sure the position for excel is exactly same with my database?
Re: Import data from excel to database
Yes, if you want to import it into an existing table. Of course, you can import into a new table and let Access make its own decisions about what data type each field will be, etc., as well as the field names (unless there is a header row in the spreadsheet with column names).rei27 wrote:That's means i must create the same table and fields for both excel and database. And the make sure the position for excel is exactly same with my database?
Re: Import data from excel to database
califdon wrote:Yes, if you want to import it into an existing table. Of course, you can import into a new table and let Access make its own decisions about what data type each field will be, etc., as well as the field names (unless there is a header row in the spreadsheet with column names).rei27 wrote:That's means i must create the same table and fields for both excel and database. And the make sure the position for excel is exactly same with my database?
Thanks a lot! I will try it!