Skip to content

Commit 72e2eed

Browse files
committed
fix_bug
1 parent 8a342be commit 72e2eed

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212

1313
[04. DDL语言](./notes/04.DDL语言.md)
1414

15-
[05. TCL语言和视图](./notes/05.TCL语言和视图.md)
15+
[05. TCL语言和视图](./notes/05.TCL语言和视图.md)
16+
17+
[06.变量、存储过程和函数](./notes/06.变量、存储过程和函数.md)
18+
19+
[07.流程控制结构](./notes/07.流程控制结构.md)

notes/06.变量、存储过程和函数.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#### 1. 全局变量
1818

19-
作用域:服务器每次启动将为所有的全局变量赋初始值,针对所有的会话(连接)有效,但不能跨重启。
19+
作用域:服务器每次启动将为所有的全局变量赋初始值,必须拥有super权限才能为系统变量赋值,针对所有的会话(连接)有效,但不能跨重启。
2020

2121
- 查看系统变量
2222
```sql
@@ -191,9 +191,9 @@ select sum;
191191

192192
#### 2. 调用语法
193193

194-
语法:`call 存储过程名(实参列表);`
194+
语法:`call 存储过程名(实参列表)`
195195

196-
**1. 空参列表**
196+
- 空参列表
197197
```sql
198198
#插入到admin表中五条记录
199199
delimiter $
@@ -206,7 +206,7 @@ end $
206206
call myp1()$
207207
```
208208

209-
**2. 创建带in模式参数的存储过程**
209+
- 创建带in模式参数的存储过程
210210
```sql
211211
#根据女神名,查询对应的男神信息
212212
create procedure myp2(in beautyName varchar(20))
@@ -227,7 +227,7 @@ end $
227227
call myp3('zhangfei', '8888')$
228228
```
229229

230-
**3. 创建带out模式的存储过程**
230+
- 创建带out模式的存储过程
231231

232232
```sql
233233
#根据女神名,返回对应的男神名
@@ -250,7 +250,7 @@ call myp5('xiaozhao', @bName, @usercp)$
250250
select @bName, @usercp$
251251
```
252252

253-
**4. 创建带inout模式的存储过程**
253+
- 创建带inout模式的存储过程
254254
```sql
255255
#传入a和b两个值,最终a和b都翻倍并返回
256256
create procedure myp6(inout a int, inout b int)

notes/07.流程控制结构.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,20 @@ end $
8282

8383
### 12.2 循环结构
8484

85+
只能用在 begin end 中
86+
8587
分类:
8688
- while
8789
- loop
8890
- repeat
8991

9092
循环控制:
91-
- iterate: 类似于 continue
92-
- leave: 类似于 break
93+
- iterate: 类似于 continue,用于结束当次循环,继续下次循环
94+
- leave: 类似于 break,用于跳出所在的循环
95+
96+
对比:
97+
1. 这三种循环都可以省略名称,但如果循环中添加了循环控制语句(leave或iterate)则必须添加名称
98+
2. loop 可以用来模拟简单的死循环
9399

94100
#### 1. while
95101

@@ -114,7 +120,7 @@ end loop 标签;
114120
标签: repeat
115121
循环体;
116122
until 结束循环的条件
117-
end while 标签;
123+
end repeat 标签;
118124
```
119125

120126
```sql

0 commit comments

Comments
 (0)