SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Trying to insert about 45k lines into my database...

    Hi all,

    I'm having a problem inserting about 45k lines into my database by a .txt file.

    The file contains:

    Code:
    INSERT INTO `jade_categories` VALUES
    ('', '0', 'Arts', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '1', 'Arts/Movies', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '2', 'Arts/Movies/Titles', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '3', 'Arts/Movies/Titles/1', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '4', 'Arts/Movies/Titles/1/10_Rillington_Place', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '5', 'Arts/Movies/Titles/1/1984_-_1984', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '6', 'Arts/Movies/Titles/1/187', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '7', 'Arts/Movies/Titles/1/187/Cast_and_Crew', 'Arts', '', '', '', '', '', '', '', ''),
    etc....
    ('', '45735', 'Arts/People/A/Anderson,_Pamela/Movies', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '45736', 'Arts/People/A/Anderson,_Pamela/Image_Galleries', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '45737', 'Arts/People/A/Anderson,_Pamela/Impersonators', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '45738', 'Arts/People/A/Anderson,_Pamela/Television', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '45739', 'Arts/People/A/Anderson,_Pamela/Directories', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '45740', 'Arts/People/A/Argento,_Asia', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '45741', 'Arts/People/A/Argento,_Asia/Movies', 'Arts', '', '', '', '', '', '', '', ''), 
    ('', '45742', 'Arts/Cultures_and_Groups', 'Arts', '', '', '', '', '', '', '', '');
    A message 'Document contains no data' keeps coming up.

    Is this due to the file being too large? How many lines of data does MYSQL take? Or is the paramenters wrong?

    MySQL Version: 3.23.58

    Cheers,

    Neil.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    you can cut down on the size of the sql file simply by re-writing the query like this --

    INSERT INTO `jade_categories` (col2, col3, col4) VALUES
    ('0', 'Arts', 'Arts'),
    ('1', 'Arts/Movies', 'Arts'),
    ('2', 'Arts/Movies/Titles', 'Arts'),
    ('3', 'Arts/Movies/Titles/1', 'Arts'),
    ('4', 'Arts/Movies/Titles/1/10_Rillington_Place', 'Arts'),
    ('5', 'Arts/Movies/Titles/1/1984_-_1984', 'Arts'),
    ('6', 'Arts/Movies/Titles/1/187', 'Arts'),
    ('7', 'Arts/Movies/Titles/1/187/Cast_and_Crew', 'Arts'),
    etc....
    ('45735', 'Arts/People/A/Anderson,_Pamela/Movies', 'Arts'),
    ('45736', 'Arts/People/A/Anderson,_Pamela/Image_Galleries', 'Arts'),
    ('45737', 'Arts/People/A/Anderson,_Pamela/Impersonators', 'Arts'),
    ('45738', 'Arts/People/A/Anderson,_Pamela/Television', 'Arts'),
    ('45739', 'Arts/People/A/Anderson,_Pamela/Directories', 'Arts'),
    ('45740', 'Arts/People/A/Argento,_Asia', 'Arts'),
    ('45741', 'Arts/People/A/Argento,_Asia/Movies', 'Arts'),
    ('45742', 'Arts/Cultures_and_Groups', 'Arts')

    after that, you may want to break it up into a few smaller chunks
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Cheers r937,

    Just got to figure out how to split the file up now with a batch file in DOS.

    Shouldn't be too difficult.

    Neil.

  4. #4
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Just to let you all know I've done it.

    After I've finished the search engine I'll place the zip file onto the server for downloading. May be handy if someone is starting a serch engine and would like aload of categories.


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
  •