Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2007
    Posts
    197

    Smile Unanswered: problem in load to MySQL

    HI,

    When want to export table in csv and load in MySQL i m using

    EXPORT TO C:\KFPSMIG\latestlivekfpsdata\livecsvkfps\KFPSCND. csv OF CSV MODIFIED BY chardel"" coldel, decpt. datesiso decplusblank MESSAGES C:\KFPSMIG\latestlivekfpsdata\livecsvkfps\KFPSCND. txt select * from KFPSCND ;

    to export

    and

    LOAD DATA LOCAL INFILE 'KFPSCND.csv' INTO TABLE kfps.KFPSCND FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\'

    to Load in MySQL

    but while i am Loading in Mysql many records are skipping in MySQL whats could be the problem please help

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    are we allowed to see any of the rows which are failing to load
    and or the column defintions
    and or any error messages

    have you tried loading a small amount of records using say the query browser, or some other tools such as PHPMyAdmin
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2007
    Posts
    197

    Smile

    Quote Originally Posted by healdem
    are we allowed to see any of the rows which are failing to load
    and or the column defintions
    and or any error messages

    have you tried loading a small amount of records using say the query browser, or some other tools such as PHPMyAdmin
    Operating system is Windows XP

    when i use fields terminated by '\t' all the rows insert but when not null values shown for varchar and same as for bigint

    when i use fields terminated by ',' rows are skipped as (2,4,6,....)no rows for (1,3,5) dont know how

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so what is different between the the odd and even numbered rows
    have you allowed for null values in the db
    operating system may be a problme if you are mixing your capitalisations.. XP can reject or accept different capitalisation.. *NIX boxes will always reject different CaPiTalisations

    as its a CSV I'd suggest delinitiating columns with a comma unless your data stream includes commas.

    ive alwasy encapsulated text columns in a character (usually)

    date times often trip up imports


    still it would be nice to know what data you are importing,
    what the table definition is
    and what the MySQL error message(s) is/are
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by healdem
    I'd suggest delinitiating columns with a comma
    um, WTF??? delinitiating ?????????
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by r937
    um, WTF??? delinitiating ?????????
    Picky, picky, picky...

    Just because he couldn't spell delimitatatizing.

    -PatP

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    seemed fair enough to me

    delineated: represented accurately or precisely

    ok it was badly spellt, but as any fule no I can't, don't, seem unable to spell check or proof read
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Jun 2007
    Posts
    197

    Smile

    Quote Originally Posted by ankur02018
    HI,


    LOAD DATA LOCAL INFILE 'KFPSCND.csv' INTO TABLE kfps.KFPSCND FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\'

    to Load in MySQL
    Please tell how to load in mysql so that blank cell in csv replaces to null in table in which we are loading

  9. #9
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    without seeing your data or your table defintions its hard to say
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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