Professional Web Applications Themes

Create table question - MySQL

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 ...

  1. #1

    Default Create table question

    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

    Dave Guest

  2. #2

    Default Re: Create table question

    com says... 

    If your main table has 197 fields, it is highly likely that you have a
    seriously flawed design.

    GM
    Geoff Guest

  3. #3

    Default Re: Create table question

    Dave G wrote: 

    I would use a scripting language like Perl or awk to p 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.
    Bill Guest

  4. #4

    Default Re: Create table question

    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

    Dave Guest

Similar Threads

  1. Create Table
    By KevinBarbee in forum Coldfusion Database Access
    Replies: 4
    Last Post: December 15th, 04:24 AM
  2. Create table overwrites existing table in mssql
    By bmyers in forum Coldfusion Database Access
    Replies: 2
    Last Post: November 25th, 10:00 AM
  3. create tmp table - how to use?
    By Jarek in forum MySQL
    Replies: 3
    Last Post: September 9th, 10:54 PM
  4. How to create a table with dynamic table name
    By cathy wang in forum Informix
    Replies: 3
    Last Post: July 17th, 12:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139