Home > database >  To generate the script to mysql import data error
To generate the script to mysql import data error

Time:09-29

Myself to write a program to read data from Excel to generate SQL statements, and then use the mysql operation, a total of 1.8 W article data, 200 error every time don't go in,
I look at the error log, below is the error:
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 '? Insert into ` bdt_batch ` values (' P080818003 ', 'scrap machinery, instrument, office at line 1
? It is wrong to
? Insert into ` bdt_batch ` values (' P080818003 ', 'scrap machinery, instrument, office equipment,' Shanghai baosteel industry and trade industrial company ', 'U02549', 'Li Ronggen', '13801602230', '5', '2008-08-18 13:41:32', '2008-08-21 10:00:00', '2008-08-21 09:00:00', ', '1', null, "', ', ', ' ', null, '2008-08-21 00:00:00', '50000', null,", ", null, ", null, ", null, '0', ', ', ', ', ', ', ', ', ', ', ', '1', 'HGB);

This article is my script statement:
Insert into ` bdt_batch ` values (' P080818003 ', 'scrap machinery, instrument, office equipment,' Shanghai baosteel industry and trade industrial company ', 'U02549', 'Li Ronggen', '13801602230', '5', '2008-08-18 13:41:32', '2008-08-21 10:00:00', '2008-08-21 09:00:00', ', '1', null, "', ', ', ' ', null, '2008-08-21 00:00:00', '50000', null,", ", null, ", null, ", null, '0', ', ', ', ', ', ', ', ', ', ', ', '1', 'HGB);

The first article of this article is my SQL, I alone run out, it is not an error, but each time you run the SQL file has an error, and I also compare the two SQL, the same, but I bring out the above operation error,

CodePudding user response:

Table structure is as follows:
The CREATE TABLE ` bdt_batch ` (
` ID ` varchar (30) NOT NULL COMMENT 'primary key (PM200600001),
` BATCH_NAME ` varchar (100) the DEFAULT NULL COMMENT 'session name,
` MEMBER_NAME ` varchar (30) DEFAULT NULL COMMENT 'username'
` MEMBER_CODE ` varchar (30) NOT NULL COMMENT 'launched bidding member code,
` CREATE_OPERATOR_NAME ` varchar (30) DEFAULT NULL COMMENT 'name generated number of operators',
` CREATE_OPERATOR_PHONE ` varchar (30) DEFAULT NULL COMMENT 'generate events operator contact,
` BATCH_STATE ` varchar (2) NOT NULL COMMENT 'entrust status: 0 - generated, 1 - published, 2. 3 - has withdraw in the bidding, 4 -- has been voided, 5 - completed',
` BATCH_DATE ` datetime NOT NULL COMMENT 'entrust application time,
` END_TIME ` datetime NOT NULL COMMENT 'end time,
` START_TIME ` datetime NOT NULL COMMENT 'start time',
` BOND_PAYMENT_STATUS ` varchar (2) the DEFAULT NULL COMMENT 'performance bond has to pay 1 - already pay 0 - did not pay (only allow this state is 1 began to auction)',
DEFAULT NULL ` SETTLEMENT_MODE ` varchar (2) the COMMENT 'settlement way: 1 - otc clearing 2 to be cleared (DEFAULT)',
` INVALID_DATE ` datetime DEFAULT NULL COMMENT 'invalid time,
` AUDIT_OPERATOR ` varchar (30) DEFAULT NULL COMMENT 'audit operator,
` STOP_OPERATOR ` varchar (30) DEFAULT NULL COMMENT 'end operator,
` INVALID_OPERATOR ` varchar (30) DEFAULT NULL COMMENT 'invalid operator,
` APPLY_OPERATOR ` varchar (30) DEFAULT NULL COMMENT 'apply for operators',
` ANNOUNCEMENT_DAY ` datetime DEFAULT NULL COMMENT 'announcement day,
` BID_DAY ` datetime DEFAULT NULL COMMENT 'bid day,
` BUYER_DEPOSIT ` decimal (20, 2) the DEFAULT NULL COMMENT 'the buyer deposit,
` SELLER_BOND ` decimal (20, 2) the DEFAULT NULL COMMENT 'sellers margin,
` FORCED_TERMINATION_REASON ` varchar (200) the DEFAULT NULL COMMENT 'forced termination reason,
` AUDIT_STOP_REASON ` varchar (200) the DEFAULT NULL COMMENT 'termination entrust audit reason (pending),
` AUDIT_STOP_DATE ` datetime DEFAULT NULL COMMENT 'termination entrust audit time (pending),
` APPLY_STOP_REASON ` varchar (200) the DEFAULT NULL COMMENT 'end to entrust application reasons (pending),
` APPLY_STOP_DATE ` datetime DEFAULT NULL COMMENT 'termination entrust application time (pending),
` REFUSE_AUDIT_REASON ` varchar (200) the DEFAULT NULL COMMENT 'refused to audit entrust reason (pending),
` AUDIT_TIME ` datetime DEFAULT NULL COMMENT 'entrust audit time (pending),
DEFAULT NULL ` IS_DIRECTIONAL_BID ` varchar (2) the COMMENT 'bid 0 stereospecific 1 non-directional,
` DIRECTIONAL_REASON ` varchar (200) the DEFAULT NULL COMMENT 'orientation, time orientation on the spot when must input',
` IS_SEND_MESSAGE ` varchar (2) the DEFAULT NULL COMMENT 'whether need to send a text message 0 not send 1',
DEFAULT NULL ` IS_SHOW_DEAL_PRICE ` varchar (2) the COMMENT 'whether according to the bid price,
DEFAULT NULL ` IS_SHOW_ORDER_PRICE ` varchar (2) the COMMENT 'whether show pricing,
DEFAULT NULL ` IS_SHOW_DEAL_MEMBER ` varchar (2) the COMMENT 'whether show the winning members'
` MINIMUM_RESPONSE ` varchar (30) DEFAULT NULL COMMENT 'minimum number of responses,
DEFAULT NULL ` ISSHOWDEALRESULT ` varchar (2) the COMMENT, 'according to clinch a deal the results'
` BIDDING_TYPE ` varchar (2) NOT NULL DEFAULT '1' COMMENT 'bidding mode: 1 - increase public price, 2 free quotation, 3 - Dutch auction',
` OFFER_TYPE ` varchar (2) NOT NULL DEFAULT '2' COMMENT 'offer way: 1 - unit price, 2 - price',
` EDITMENT ` longtext COMMENT 'agreement',
DEFAULT NULL ` IS_SHOW_STARTING_PIRCE ` varchar (2) the COMMENT 'whether display opening bid 1 (the DEFAULT) 2 don't show',
` VERSION ` int (11) the DEFAULT '1' COMMENT 'VERSION control (optimistic locking),
` DOAMIN ` varchar (10) the DEFAULT 'HGB' COMMENT 'domain'
The PRIMARY KEY (` ID `)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CodePudding user response:

Data line:
Insert into ` bdt_batch ` values (' P080818003 ', 'scrap machinery, instrument, office equipment,' Shanghai baosteel industry and trade industrial company ', 'U02549', 'Li Ronggen', '13801602230', '5', '2008-08-18 13:41:32', '2008-08-21 10:00:00', '2008-08-21 09:00:00', ', '1', null, "', ', ', ' ', null, '2008-08-21 00:00:00', '50000', null,", ", null, ", null, ", null, '0', ', ', ', ', ', ', ', ', ', ', ', '1', 'HGB);
Insert into ` bdt_batch ` values (' P080818007 ', 'general tube for', 'Shanghai baosteel trade co., LTD', 'U00109', 'Cao Hengliang', '11111111111', '5', '2008-08-18 15:15:10', '2008-08-19 15:00:00', '2008-08-19 14:00:00', ', '1', null, "', ', ', ' ', null, '2008-08-19 00:00:00', '20000', null,", ", null, ", null, ", null, '0', ', ', ', ', ', ', ', ', ', ', ', '1', 'HGB);
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related