Please help me

[expired user #9513]'s profile image [expired user #9513] posted 8 years ago in HeidiSQL portable Permalink

Hi. When I am trying to import csv file in heidisql it is giving error, "your file was imported but the server returned 64 warnings/or notes. See log panel for details" I have tried to change the control characters firstly it was ; then I changes into , but still warnings are there. and data imported in the table is not in sequence, first column data is missing which is taking second coulmn values and so on, and last attribute shows only NULL.

What should I do? please help me out.

ansgar's profile image ansgar posted 8 years ago Permalink

You should check the control characters you put into the CSV import dialog of HeidiSQL, namely line terminator, field terminator etc. They must match to the contents of your CSV file. It's a common pitfall to get broken data when you don't put in the right characters there.

[expired user #9513]'s profile image [expired user #9513] posted 8 years ago Permalink

How could I come to know about the other terminators as I only know about the one terminator that instead of semicolon I used comma as csv file was comma separated file

ansgar's profile image ansgar posted 8 years ago Permalink

Well, the dialog asks for these characters?

[expired user #9513]'s profile image [expired user #9513] posted 8 years ago Permalink

Yes in dialog I changed semicolon into comma, it worked somehow as values are being assigned in the columns but the values are not in right order for example first column has second column's values and so on and last column is showing "null". Do I have to change other control characters as well like 1)Fields enclosed by is set as " 2) fields escaped by is set as " and 3) line terminator is set as \r\n.

Are these correct? if not then please suggest me what changes I should make in it.. Thanks a lot for reply.

ansgar's profile image ansgar posted 8 years ago Permalink

I need the textfile and your table definition to give you more help.

[expired user #9513]'s profile image [expired user #9513] posted 8 years ago Permalink

I am sending CSV file which I am trying to import in heidisql and screenshots as well. Thanks

3 attachment(s):
[expired user #9513]'s profile image [expired user #9513] posted 8 years ago Permalink

Thanks a lot

1 attachment(s):
  • Capture2
ansgar's profile image ansgar posted 8 years ago Permalink

Please just copy the text from the "CREATE code" tab, so I don't have to type every bit from your screenshot :)

[expired user #9513]'s profile image [expired user #9513] posted 8 years ago Permalink

Yeah sure :)

CREATE TABLE `expenses1` (
    `ID` INT(30) NOT NULL AUTO_INCREMENT,
    `Provider` VARCHAR(50) NULL DEFAULT NULL,
    `hospital_name` VARCHAR(50) NULL DEFAULT NULL,
    `Address` VARCHAR(50) NULL DEFAULT NULL,
    `city` VARCHAR(30) NULL DEFAULT NULL,
    `state` VARCHAR(30) NULL DEFAULT NULL,
    `zipcode` VARCHAR(30) NULL DEFAULT NULL,
    `countyName` VARCHAR(30) NULL DEFAULT NULL,
    `PhoneNum` TEXT NULL,
    `measureNum` VARCHAR(30) NULL DEFAULT NULL,
    `measureId` VARCHAR(10) NULL DEFAULT NULL,
    `score` VARCHAR(10) NULL DEFAULT NULL,
    `Footnote` VARCHAR(30) NULL DEFAULT NULL,
    `measureStartDate` VARCHAR(10) NULL DEFAULT NULL,
    `measureEndDate` VARCHAR(10) NULL DEFAULT NULL,
    `locaion_id` VARCHAR(30) NULL DEFAULT NULL,
    PRIMARY KEY (`ID`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=683640
;
ansgar's profile image ansgar posted 8 years ago Permalink

Your textfile contains mixed linebreaks. Just normalized these here to Windows linebreaks, but still am not able to import it. Method "Server parses file contents" (LOAD DATA) gives me this error and breaks the connection:

SQL Error (2027): Malformed packet

Method "Client parsing" does what you described above.

I would recommen going through the first 2 or 3 rows of the file, be sure they contain the same number of commas.

[expired user #9513]'s profile image [expired user #9513] posted 8 years ago Permalink

I tried other CSV files as well but it shows same errors/warnings. I don't understand why it is so. Thanks for your reply.

Please login to leave a reply, or register at first.