Home > Software engineering >  MariaDB insert values that contain a hash character
MariaDB insert values that contain a hash character

Time:12-05

I have been searching for a solution to this issue without any luck..

I have a SQL file that is inserting values, some have the character # in it.. Mysql thinks its a command and throws an error "Unknown command '\A'.. The file is 68mb

INSERT INTO mytable(
   Number,Description,Holder,
   Address,City,
   State,PostalCode,Country,ApplicationDate,
   Status,StatusDate,Current,Models,CTNumbers,
   ProductType,ProductSubtype,OPR) 
VALUES (
   '378976','Replacement of Protective Breathing Equipment','Infinion Certification Engineering',
   '#12-6213 TWP RD 122','Cypress County',
   'Aberta','T1A 8M4','Canada','7/30/2021',
   'Issued','09/23/2021',1,'The Horting Company\','A16WE',
   'Vehicle','Large','New York ACO Branch, Tel:  1 (xxx) xxx-xxxx');

That issue is with '#12-6213 TWP RD 122',

Mysql throws this:

ERROR at line 2865: Unknown command '\A'.

Is there are way run this sql without having to edit a 68mb file?

CodePudding user response:

Remove the \ after The Horting Company. This is causing the issue.

Or use double backslash \\.

  • Related