[Eclug] mysql load data syntax?

  • Previous message: [Eclug] Cogan Fair
  • Next message: [Eclug] mysql load data syntax?
  • R. Mariotti r.mariotti at fdcx.net
    Mon Dec 4 16:09:45 EST 2006

     

    fellow luggers:
    
    On the following inherited sql load statement I keep getting syntax 
    errors for the 'particular version' I am using.  Currently using mysql 
    5.0.22
    
    Can anyone "SEE" any syntactical error?  If so please advise?
    
    Thanks
    
         $query="LOAD DATA
         INFILE '$dbfile'
         INTO TABLE $tablename IGNORE
         FIELDS TERMINATED BY \",\"
         ENCLOSED BY \"'\"
         ( 'invoice_no',
         'date',
         'po',
         'terms',
         'custid',
         'addrcustid',
         'name',
         'addr1',
         'addr2',
         'citystate',
         'amtdue',
         'dbid',
         'page_no',
         'file',
         'file_location' )";
    
        $cmd=$dbh->do($query) or $error_msg.="Could not execute $query: 
    $DBI::errstr\n";
    
    The errors point to the fields terminated by area but even when I remove 
    them I still get the errors.  Also, I've tried different quoting 
    characters (i.e." \''\' instead of \"'\") with no better results.
    
    Thank anyone.
    
    Bob
    
    

     

     

    More information about the ECLUG mailing list