Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Error Importing CSV File

forums forums SQLyog Using SQLyog Error Importing CSV File

  • This topic is empty.
Viewing 12 reply threads
  • Author
    Posts
    • #8825
      bimp
      Member

      Using SQLyog Enterprise v4.01 and having trouble importing a CSV file. Keep getting the error message:

      “Error while importing data”. Don't get any other helpful error message in History tab.

      I have a table that consists of the following:

      exp_pricelist_prices

      ==============

      Field Type Null Key Default Extra Privileges








      price_id smallint(6) unsigned PRI (NULL) auto_increment select,insert,update,references

      printsize_id smallint(6) 0 select,insert,update,references

      pricelist_id smallint(6) 0 select,insert,update,references

      price float 0 select,insert,update,references

      sort tinyint(4) 50 select,insert,update,references

      In the import dialog box, I make sure to de-select the 'price_id' primary key column. My csv file only contains

      the other 4 field data. I also have the fields terminated by comma and have tried both n and rn for line

      terminators. I also make sure to ignore the first line which contains the field headers.

      I've attached my CSV file. Please help.

    • #17098
      bimp
      Member

      Using SQLyog Enterprise v4.01 and having trouble importing a CSV file. Keep getting the error message:

      “Error while importing data”. Don't get any other helpful error message in History tab.

      I have a table that consists of the following:

      exp_pricelist_prices

      ==============

      Field Type Null Key Default Extra Privileges








      price_id smallint(6) unsigned PRI (NULL) auto_increment select,insert,update,references

      printsize_id smallint(6) 0 select,insert,update,references

      pricelist_id smallint(6) 0 select,insert,update,references

      price float 0 select,insert,update,references

      sort tinyint(4) 50 select,insert,update,references

      In the import dialog box, I make sure to de-select the 'price_id' primary key column. My csv file only contains

      the other 4 field data. I also have the fields terminated by comma and have tried both n and rn for line

      terminators. I also make sure to ignore the first line which contains the field headers.

      I've attached my CSV file. Please help.

    • #17099
      Ritesh
      Member

      Can you cut-n-paste the CREATE TABLE STMT… for the table?

    • #17100
      bimp
      Member

      Ritesh, thanks for replying. Here it is:

      CREATE TABLE `exp_pricelist_prices` (

      `price_id` smallint(6) unsigned NOT NULL auto_increment,

      `printsize_id` smallint(6) NOT NULL default '0',

      `pricelist_id` smallint(6) NOT NULL default '0',

      `price` float NOT NULL default '0',

      `sort` tinyint(4) NOT NULL default '50',

      PRIMARY KEY (`price_id`)

      ) TYPE=MyISAM;

    • #17101
      Ritesh
      Member

      I was successfuly able to import 92 rows of data in the file without any problem. The screenshots depict the steps I followed.

    • #17102
      Ritesh
      Member

      Create table using the statement provided by you.

    • #17103
      Ritesh
      Member

      Select Table -> Export/Import -> Import data from CSV… and enter the correct values.

    • #17104
      Ritesh
      Member

      Click Import

    • #17105
      Ritesh
      Member

      Which version of MySQL are you using?

    • #17106
      bimp
      Member

      Ritesh, very interesting.

      I'm using 3.23.58 on Windows XP

    • #17107
      bimp
      Member

      Ritesh, I finally got it to work.

      This time around the only difference was that my escape string was \ instead of

    • #17108
      Ritesh
      Member
      Code:
      version()    
      ————–
      3.23.58-max-nt

      Same result.

      My history tab shows the following query.

      Code:
      load data local infile 'D:/Documents and Settings/Administrator/Desktop/Fulfillment_Catalog_exp_pricelist_prices.txt' into table `bimp`.`exp_pricelist_prices` fields escaped by '\' terminated by ',' lines terminated by 'rn' ignore 1 lines ( `printsize_id`, `pricelist_id`, `price`, `sort` )
    • #17109
      bimp
      Member

      I really don't know why it worked this time around. I'm just gald it works… maybe your good karma did it. I was able to push the data to all my dev, staging, and live databases.

      Thanks.

Viewing 12 reply threads
  • You must be logged in to reply to this topic.