Introduction to the use of SQL Assistant 2.0 in DM8

I believe you will encounter the problem of writing wrong SQL or forgetting SQL syntax in your daily work. In Dameng's new-generation database product DM8, a brand-new SQL Assistant 2.0 was launched to help developers and operation and maintenance personnel to better write SQL statements. This article will show you how to open and use the new version of SQL Assistant in DM8.

 

1. Turn on the SQL assistant function

 

By default, the function of SQL Assistant is not enabled. So we need to open the relevant settings in the options of the management tool. Choose Window -> Options -> Query Analyzer -> Editor.

 

 

The new version of SQL Assistant is divided into two parts, SQL Syntax Check and SQL Input Assistant, which correspond to SQL syntax error correction and SQL input prompts respectively. Compared with DM7, the SQL assistant in DM8 can take effect once the option is turned on, and there is no need to restart the management tool, which is very convenient.

 

2. SQL syntax check demo

 

After the syntax check is turned on, we try to enter a SQL statement, such as

 

 

At this time, for the wrong keyword spelling, the management tool will have a squiggly prompt and mark it in front of the relevant sentence. With this function, my mother no longer has to worry about my misspelling procedure. In addition, not only is the spelling error, but the SQL assistant can also prompt the wrong grammatical logic, such as

 

 

Here we have written an extra value by mistake, and the tool can recognize it and give it a hint.

 

3. SQL input assistant demo

 

Another function of SQL Assistant is the prompt of SQL input. After turning on this function, the system will prompt the user to enter SQL in real time. The content of the prompt includes database objects and SQL keywords. For example, when we want to create a database object, we enter create and press the space

 

 

The system will list all possible keyword names. And the list will change in real time with the user’s input, for example, after we enter t

 

 

The system will guess the follow-up content you want to enter and put it in the list for you to choose.

In addition to the addition of keywords, a more important part of SQL Assistant is that it can prompt for data object names. For example, when we want to query a table in DMHR mode, after entering dmhr., the system will help us list all objects in DMHR mode:

 

 

Furthermore, when we query the EMPLOYEE table in DMHR mode, we want to filter certain columns:

 

 

As you can see, the system has helped us list all the columns in the EMPLOYEE table and the corresponding data types for us to choose. In this way, it saves us the time to query the table structure and provides great convenience for the writing of SQL statements.

Guess you like

Origin blog.csdn.net/qq_42726883/article/details/108577641