0

I have looked on stackoverflow and the mysql and Plantmysql forums

Nobody has quite been able to answer this.

Steps

  1. I created a CSV from an Excel file
  2. Imported using the Table Data Import Wizard in MySQL

I am able to run

SELECT * FROM apporteur_mapping_table;

However I get Error Code 1054 when I run

SELECT broker_code FROM apporteur_mapping_table;

Field type is VARCHAR(20)

Update #2 - output from SHOW Create Table

CREATE TABLE `apporteur_mapping_table` (
  `broker_code` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `broker_name` text COLLATE utf8_unicode_ci,
  `date_de_creation_de_code` text COLLATE utf8_unicode_ci,
  `commercial_contact_name` text COLLATE utf8_unicode_ci,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1690 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

3 Resolved

I seem to have been able to resolve it by Creating the table in code from scratch. It seems using the Table Data Import Wizard in mysql caused the data to have some interpretation

I am using MySQL Workbench 6.3 on Windows 10

Annotation can be found here

Link to CSV source here

Anyone able to help?

James Ojo
  • 1
  • 3
  • 2
    What is the output of `DESCRIBE apporteur_mapping_table`? The error is obvious / self explanatory. – Daniel W. Nov 08 '17 at 15:19
  • 2
    Hmm...is it possible somehow that whitespace got into your column names? – Tim Biegeleisen Nov 08 '17 at 15:19
  • 1
    In your second screenshot it looks like the column is named `broker code` with a space instead of an `_`. It's legal to have column names containing a space, but you have to delimit them every time you use them: `select \`broker code\` from apporteur_mapping_table`. Most people decide it's easier to avoid using whitespace in their column names. :) – Bill Karwin Nov 08 '17 at 15:19
  • do a `SHOW CREATE TABLE apporteur_mapping_table` ... my bet is similar to TB and BK... that there's (unintended) white space or a funky character encoding included in the column name, I'd run a query to check `SELECT column_name, HEX(column_name) FROM information_schema.columns WHERE table_name = 'apporteur_mapping_table' AND table_schema = 'yourdbname' ;` – spencer7593 Nov 08 '17 at 15:26
  • @DanFromGermany the output can be found in the first screenshot [here](https://www.dropbox.com/s/bnxyl31dh9hfv8l/Error%20Code%201054.pdf?dl=0) – James Ojo Nov 08 '17 at 22:31
  • @spencer7593 I appended the output of SHOW CREATE TABLE in the original post – James Ojo Nov 09 '17 at 09:40
  • I can't say for certain that there was white space however creating the table from scratch seems to have resolved it – James Ojo Nov 09 '17 at 12:30

0 Answers0