This is a discussion on Create table question within the MySQL Database forums, part of the Database Forums category; This is my first mySQL project and it's a conversion of a system written in Retrieve 4GL. The main ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This is my first mySQL project and it's a conversion of a system
written in Retrieve 4GL. The main data table has got 197 fields - far too many to enter manually, so I'm looking for a short cut. If I can get hold of a CSV file of the old data, where the first row contains the field names, is there a way of creating the table AND importing the data at the same time - or even just creating the table and dealing with the data later? Unless I'm missing something, it doesn't seem that mySQLImport can do this, nor does phpMyAdmin as far as I can see. (btw, MS Access can, annoyingly). And I haven't managed to find the answer by googling. Any suggestions gratefully received. Thanks Dave |
|
|||
|
DaveGriffiths70@gmail.com says...
> This is my first mySQL project and it's a conversion of a system > written in Retrieve 4GL. The main data table has got 197 fields - far > too many to enter manually, so I'm looking for a short cut. If your main table has 197 fields, it is highly likely that you have a seriously flawed design. GM |
|
|||
|
Dave G wrote:
> If I can get hold of a CSV file of the old data, where the first row > contains the field names, is there a way of creating the table AND > importing the data at the same time - or even just creating the table > and dealing with the data later? I would use a scripting language like Perl or awk to parse the CSV file and generate a CREATE TABLE statement. Then run the output of that script using the mysql command-line client. I agree with Geoff that a table with 197 columns is probably not a good schema design. But that's not what you asked for help with. Regards, Bill K. |
|
|||
|
I agree about 197 fields - but I'm stuck with it. The Retrieve 4GL
system that this data is coming from is still in use. And at the time of writing I've never even seen it !! Looks like a bit of fiddling around to create this table - never mind, it has only got to be done once. Dave |