List:General Discussion« Previous MessageNext Message »
From:Freedom Advocate Date:December 3 2002 3:27am
Subject:I don't understand this error!
View as plain text  
This is the command I am having problems with and the error that I am getting. 
What follows is some things I did to troubleshoot this problem. I can't see 
any problems with the SQL and as I note below, the line works fine when I 
apply it to the DB after getting the error. Help!

[root@Casey root]# mysql -u root -p < po_file
Enter password:
ERROR 1064 at line 950282: You have an error in your SQL syntax near 
'020750000030009219','09','20','35','N',' ',00013,'
  ',000000.9500,000000.6318,'' at line 1

/* This is the line before the error occurs and the command used to get it.*/
[root@Casey root]# cat -n po_file | grep 950281 | more
950281  INSERT INTO comment_lines 
VALUES('020750000030009219','09','20','35','N'
,' ',00002,'REQUISITIONED BY BILLYBOB
            ');

/* Here is the bad line 950282 below. I put it into it's own test file and
tried the command line again.  Didn't get an error (with empty and all 
previous data. */
[root@Casey root]# cat test.sql
use purchase_orders;
INSERT INTO comment_lines VALUES('020750000030009219','09','20','35','N'
,' ',00003,'                                        ');


/* This is the line after the error occurs and the command used to get it.*/
[root@Casey root]# cat -n po_file | grep 950283 | more
950283  INSERT INTO comment_lines 
VALUES('020750000030009219','09','20','35','N'
,' ',00004,'                                        ');


mysql> describe comment_lines;
+-------------------+-----------------------+------+-----+---------+-------+
| Field             | Type                  | Null | Key | Default | Extra |
+-------------------+-----------------------+------+-----+---------+-------+
| po_index          | varchar(18)           |      | PRI |         |       |
| batch_month       | char(2)               |      | PRI | 0       |       |
| batch_day         | char(2)               |      | PRI | 0       |       |
| batch_number      | char(2)               |      | PRI | 0       |       |
| changed_indicator | char(1)               |      |     |         |       |
| maintenance_code  | char(1)               |      |     |         |       |
| line_number       | mediumint(5) unsigned |      | PRI | 0       |       |
| comment           | varchar(40)           |      |     |         |       |
+-------------------+-----------------------+------+-----+---------+-------+



root@Casey root]# ls -al po_file
-rw-r--r--    1 root     root     468787771 Dec  2 20:56 po_file


Thread
I don't understand this error!Freedom Advocate3 Dec
RE: I don't understand this error!daniel3 Dec
RE: I don't understand this error!daniel3 Dec
Re: I don't understand this error!Freedom Advocate3 Dec