简体   繁体   中英

MySQL error “empty string given as argument for ! character”

I have a very simple query

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

The query worked before but for some reason now I am getting an error:

Error:Error formatting SQL query: empty string given as argument for ! character

Anyone has any idea why I am getting this error? Any help hugely appreciated

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

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

Secondly, you'll get this error when no database is selected. There's two ways you can select one.

Let's look at what it looks like when no databases are selected:

在此输入图像描述

as you can see it's not bold. This can be easily fixed by double clicking on the database name, or right clicking and choosing " Set as Default Schema ":

在此输入图像描述
在此输入图像描述

Should you still not see any database selected on the left side, you can force it by using the SQL command USE like so: USE `dbname`; (where dbname is your database name):

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM