Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
fdf067c1
Commit
fdf067c1
authored
May 22, 2001
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ELSEIF PL/PgSQL doc patch.
Klaus Reger
parent
e6ba9213
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
7 deletions
+41
-7
doc/src/sgml/plsql.sgml
doc/src/sgml/plsql.sgml
+41
-7
No files found.
doc/src/sgml/plsql.sgml
View file @
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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment