Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-08-2004, 12:15 AM   #1 (permalink)
infinite_root
Registered User
 
infinite_root's Avatar
 
Join Date: Apr 2004
Posts: 26
infinite_root is on a distinguished road
Error SQL-query in importing file

Hi Everyone,

Had this problem importing our previous database (.dbf) into MySQL.

I had these report history.dbf which I converted into .txt file to be imported into MySQL using phpMyAdmin.

However, everytime I attempt the import the following error appeared:

Error
SQL-query :
INSERT INTO history
VALUES (
'00000', '050VOA', '050', 'OLR', '19841126', '19851108', '11', '0', '', 'TAIWO', '', 'PHIL. TRANSMARINE CARRIERS', '' , , , '12', '', '', ''
)
MySQL said:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ','12','','','')' at line 1


Here's somepart of history.txt:
# Structure Definition for Master Table 'history'
#
CREATE TABLE history (CREWCODE CHAR(5) NOT NULL,VESSEL CHAR(6) NOT NULL,PRINCIPAL CHAR(3) NOT NULL,RANK CHAR(8) NOT NULL,SIGNONDATE CHAR(8) NOT NULL,SIGNOFDATE CHAR(8) NOT NULL,MONTHS CHAR(2) NOT NULL,TERMNCODE CHAR(2) NOT NULL,QUALNCODE CHAR(2) NOT NULL,VSSLNAME CHAR(40) NOT NULL,VSSLTYPE CHAR(29) NOT NULL,REMARKS CHAR(30) NOT NULL,FAXINFO CHAR(25) NOT NULL,NOTES LONGBLOB NULL,NFRREMARKS LONGBLOB NULL,DAYS CHAR(2) NOT NULL,GROSS CHAR(30) NOT NULL,ENGINE CHAR(40) NOT NULL,MEDINFO CHAR(25) NOT NULL,MEDICAL LONGBLOB NULL);
#
# Data for Table 'history'
#
INSERT INTO history VALUES('00000','050VOA','050','OLR','19841126','19 851108','11','0','','TAIWO','','PHIL. TRANSMARINE CARRIERS','',,,'12','','','',); // Line 1: this is where the problem emanated

INSERT INTO history VALUES('00000','050VOA','050','OLR','19860518','19 870203','8','2','','TAIHO','','PHIL. TRANSMARINE CARRIERS','',,,'15','','','',);

INSERT INTO history VALUES('00001','050VOA','050','A/B','19840721','19880404','44','2','','NO.3 KENDARI','LOGSHIP','ABACAST','',,,'13','','','',);

INSERT INTO history VALUES('00001','001FWL','001','O/S','19880905','19900118','16','2','','FINNWHALE',' BULK','','',,,'13','','','',);

INSERT INTO history VALUES('00001','001FBR','001','A/B','19900510','19910517','12','2','','FINNBEAVER', 'BULK','','',,,'7','','','',);

INSERT INTO history VALUES('00001','010NPN','010','A/B','19911018','19920901','10','2','','CPC NIPPON','HEAVY LIFT','','',,,'13','','','',);

Do you see any problem? How can I overcome this? Hope you can help me.

Thank you very much.

More power!
infinite_root is offline   Reply With Quote
Old 06-08-2004, 05:17 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
there are 2 blank fields before the 12. try placing the word NULL in them:

'',NULL,NULL,'12'

if you don't want them to be null, then put 2 single quotes

'','','','12'
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 02:04 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting