Posts

Showing posts from June, 2025

The MySQL SQL Error 1064 Blues

Image
          Writing error messages is an art. Sadly, most of us lack talent in that area. One of the prime examples that you see with SQL User Interfaces is the MySQL SQL Error 1064. SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select @var' at line 2 Error position: line: 1 Explicit and clear, it ain't.  I am using DBeaver for this example, but the issue can be reproduced on MySQL Workbench, Toad, and many other tools.  In the following, an environment variable is set on the first line, and then a SELECT is used to return that variable. However, we receive a response of 1064.  So what happened?  While both lines were input to the console, only the second line was executed. When we ask the server about @var, it has no knowledge of it and replies with the 1064 Error. "But we typed it in!" Yeah, we typed it in, but the set was not e...

MySQL Entity Relationship Maps With DBeaver

Image
    Even the most experienced database professionals are known to feel a little anxious when peering into an unfamiliar database. Hopefully, they will inspect how the data is normalized and how the various tables are combined to answer complex queries.  Entity Relationship Maps (ERM) provide a visual overview of how tables are related and can document the structure of the data.     The Community Edition of  DBeaver  can easily provide an ERM. First, connect to the database. Right-click on 'Tables' and then select 'View Diagram'.      The ERM is displayed.   And it gets better! Are you not sure how two tables are joined? Click on the link between the tables, and the names of the columns you want to use in your JOIN statement are highlighted. Conclusion     Exploring an unfamiliar database can be daunting. Entity Relationship Maps provide a way to navigate the territory, and  DBeaver  is a fantastic tool for w...