In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The normal execution of line sentences
Set up bc website Q
For example, to execute multiple normally executed statements, the example command is as follows:
Select version ()
Select "Hello LiuMiao" as "Greetings"
Select 20: 22 as Result
Using the HereDocument method, do the following:
Liumiaocn:~ liumiao$ mysql-uroot-proot select "Hello LiuMiao" as "Greetings"
> select 20: 22 as Result
> EOF
Mysql: [Warning] Using a password on the command line interface can be insecure.
Version ()
8.0.11
Greetings
Hello LiuMiao
Result
forty-two
Liumiaocn:~ liumiao$
The default action when an error occurs in the middle of a multiline statement
Oracle multiline statements continue to execute in sqlplus when there is an error, but what happens in the mysql console? We can add an incorrect syntax or command to the above statement to verify:
Mysql-uroot-proot select 20: 22 as Result
> EOF
Mysql: [Warning] Using a password on the command line interface can be insecure.
Version ()
8.0.11
ERROR 1064 (42000) at line 2: 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 'errorcommand' at line 1
Liumiaocn:~ liumiao$
As you can see, it stops by default when it encounters an error.
WHENEVER SQLERROR
It is controlled by WHENEVER SQLERROR in oracle. The syntax is as follows
WHENEVER SQLERROR {EXIT [SUCCESS | FAILURE | WARNING | n | variable |: BindVariable] [COMMIT | ROLLBACK] | CONTINUE [COMMIT | ROLLBACK | NONE]}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.