Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
fdf067c1
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fdf067c1
编写于
5月 22, 2001
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ELSEIF PL/PgSQL doc patch.
Klaus Reger
上级
e6ba9213
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
7 deletion
+41
-7
doc/src/sgml/plsql.sgml
doc/src/sgml/plsql.sgml
+41
-7
未找到文件。
doc/src/sgml/plsql.sgml
浏览文件 @
fdf067c1
<
!--
$
Header
:
/
cvsroot
/
pgsql
/
doc
/
src
/
sgml
/
Attic
/
plsql
.
sgml
,
v
2.3
2
2001
/
05
/
17
21
:
50
:
16
petere
Exp
$
$
Header
:
/
cvsroot
/
pgsql
/
doc
/
src
/
sgml
/
Attic
/
plsql
.
sgml
,
v
2.3
3
2001
/
05
/
22
13
:
52
:
27
momjian
Exp
$
-->
<
chapter
id
=
"plpgsql"
>
...
...
@@ -880,12 +880,11 @@ RETURN <replaceable>expression</replaceable>
<title>Conditional Control: IF statements</title>
<para>
<function>IF</function> statements let you take action
according to certain conditions. PL/pgSQL has three forms of
IF: IF-THEN, IF-THEN-ELSE, IF-THEN-ELSE IF. NOTE: All
PL/pgSQL IF statements need a corresponding <function>END
IF</function> statement. In ELSE-IF statements you need two:
one for the first IF and one for the second (ELSE IF).
<function>IF</function> statements let you execute commands based on
certain conditions. PL/PgSQL has four forms of IF: IF-THEN, IF-THEN-ELSE,
IF-THEN-ELSE IF, IF-THEN-ELSIF-THEN-ELSE. NOTE: All PL/PgSQL IF statements need
a corresponding <function>END IF</function> clause. With ELSE-IF statements,
you need two: one for the first IF and one for the second (ELSE IF).
</para>
<variablelist>
...
...
@@ -979,6 +978,41 @@ END IF;
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
IF-THEN-ELSIF-ELSE
</term>
<listitem>
<para>
IF-THEN-ELSIF-ELSE allows you test multiple conditions
in one statement. Internally it is handled as nested
IF-THEN-ELSE-IF-THEN commands. The optional ELSE
branch is executed when none of the conditions are met.
</para>
<para>
Here is an example:
</para>
<programlisting>
IF number = 0 THEN
result := ''zero'';
ELSIF number < 0 THEN
result := ''negative'';
ELSIF number > 0 THEN
result := ''negative'';
ELSE
-- now it seems to be NULL
result := ''NULL'';
END IF;
</programlisting>
</para>
</listitem>
</varlistentry>
</variablelist>
</sect3>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录