eve_mf eve_mf - 1 year ago 88
MySQL Question

MySQL Workbench 6.0 - incorrect syntax template

I am new using MySQL Workbench, I am actually discovering it now.

I can't find a clear tutorial or documentation where they explain why it is this syntax.

I have a table, called chefs, with id, name and country columns. I want to populate this table, using MySQL Workbench, following the tutorial, I end up doing right click on the table I want to insert, then click "send to SQL editor", and then click on "Insert statement". When I do this, a template appears on my Query screen like this:

INSERT INTO `cooking_book_new`.`chefs`
(<{id: }>,
<{name: }>,
<{country: }>);

enter image description here

I have checked and verified, that if I use the regular syntax I use to use for mysql it inserts the row:

INSERT INTO chefs (id, name, country) VALUES (1, 'chef1', 'Country1');

But, as the whole point of trying to use this software is to make everything easier, I would like to know why it prepares that query, and how should I introduce the data there.

I have tried this:

INSERT INTO `cooking_book_new`.`chefs`

And also this:

INSERT INTO `cooking_book_new`.`chefs`
(<{id:1 }>,
<{name:'chef1' }>,
<{country:'country1' }>);

But everything seems wrong. Does anyone know how to use this syntax? I know I could just do the query as I have tested that works like:

INSERT INTO chefs (id, name, country) VALUES (1, 'chef1', 'Country1');

But it would be better if I understand how MySQL workbench works.

Thank you!

Answer Source

The manual for Workbench probably contains an explanation for it, but given that it is so large, it would (probably) take (me) much longer to keep searching, as I did and finding something on their website with similar syntax.

As per the manual:


The <{}> are only representational (expressions) values.

For example:

Update Statement

UPDATE `sakila`.`actor`
`first_name` = <{first_name}>
WHERE <{where_expression}>;

Let's look at the manual on INSERT:


You're not going to use {VALUES | VALUE} or the rest of those [...] right? Those are "options".

    [INTO] tbl_name
    [PARTITION (partition_name,...)]

It is up to you to replace those "representational" values with the proper syntax, that needs to be used in conjunction with the reference manual.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download