MySQL Error "empty string specified as argument for character!"

I have a very simple request

select * from tablename where keyvar is not null order by keyvar 

The request worked before, but for some reason I get an error:

Error: SQL query formatting error: empty string specified as argument to! symbol

Does anyone have an idea why I am getting this error? Any help is much appreciated

PS: If I run all the code again from scratch (creating a database, loading a csv file, etc.), the request works fine.

+5
source share
1 answer

First of all, this is not a MySQL error - this is a MySQL Workbench error (you can see it in the Oracle source code here ).

Secondly, you will get this error if the database is not selected. You can choose one of two ways.

See how it looks when no databases are selected:

enter image description here

as you can see it is not bold. This can be easily fixed by double-clicking on the database name or by right-clicking and selecting "Set as default schema":

enter image description here
enter image description here

If you still do not see any database selected on the left side, you can force it using the SQL USE as follows: USE `dbname`; (where dbname is the name of your database):

enter image description here

+13
source

Source: https://habr.com/ru/post/1207681/


All Articles