Skip to content

Commit cf9fd80

Browse files
committed
Example for create function using argument names
Gavin Sherry
1 parent af4de81 commit cf9fd80

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

doc/src/sgml/ref/create_function.sgml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_function.sgml,v 1.57 2004/06/25 07:05:34 dennis Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_function.sgml,v 1.58 2004/07/11 23:23:43 momjian Exp $
33
-->
44

55
<refentry id="SQL-CREATEFUNCTION">
@@ -398,6 +398,17 @@ CREATE FUNCTION add(integer, integer) RETURNS integer
398398
LANGUAGE SQL
399399
IMMUTABLE
400400
RETURNS NULL ON NULL INPUT;
401+
</programlisting>
402+
</para>
403+
404+
<para>
405+
Increment an integer, making use of an argument name, in PL/PgSQL:
406+
407+
<programlisting>
408+
CREATE OR REPLACE FUNCTION increment(i integer) RETURNS integer AS '
409+
BEGIN
410+
RETURN i + 1;
411+
END;' LANGUAGE plpgsql;
401412
</programlisting>
402413
</para>
403414
</refsect1>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy