|
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>37.4. User-Defined Procedures</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="xfunc.html" title="37.3. User-Defined Functions" /><link rel="next" href="xfunc-sql.html" title="37.5. Query Language (SQL) Functions" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">37.4. User-Defined Procedures</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="xfunc.html" title="37.3. User-Defined Functions">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="extend.html" title="Chapter 37. Extending SQL">Up</a></td><th width="60%" align="center">Chapter 37. Extending <acronym xmlns="http://www.w3.org/1999/xhtml" class="acronym">SQL</acronym></th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="xfunc-sql.html" title="37.5. Query Language (SQL) Functions">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="XPROC"><div class="titlepage"><div><div><h2 class="title" style="clear: both">37.4. User-Defined Procedures</h2></div></div></div><a id="id-1.8.3.7.2" class="indexterm"></a><p>
- A procedure is a database object similar to a function. The difference is
- that a procedure does not return a value, so there is no return type
- declaration. While a function is called as part of a query or DML
- command, a procedure is called explicitly using
- the <a class="xref" href="sql-call.html" title="CALL"><span class="refentrytitle">CALL</span></a> statement.
- </p><p>
- The explanations on how to define user-defined functions in the rest of
- this chapter apply to procedures as well, except that
- the <a class="xref" href="sql-createprocedure.html" title="CREATE PROCEDURE"><span class="refentrytitle">CREATE PROCEDURE</span></a> command is used instead, there is
- no return type, and some other features such as strictness don't apply.
- </p><p>
- Collectively, functions and procedures are also known
- as <em class="firstterm">routines</em><a id="id-1.8.3.7.5.2" class="indexterm"></a>.
- There are commands such as <a class="xref" href="sql-alterroutine.html" title="ALTER ROUTINE"><span class="refentrytitle">ALTER ROUTINE</span></a>
- and <a class="xref" href="sql-droproutine.html" title="DROP ROUTINE"><span class="refentrytitle">DROP ROUTINE</span></a> that can operate on functions and
- procedures without having to know which kind it is. Note, however, that
- there is no <code class="literal">CREATE ROUTINE</code> command.
- </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="xfunc.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extend.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="xfunc-sql.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">37.3. User-Defined Functions </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 37.5. Query Language (<acronym class="acronym">SQL</acronym>) Functions</td></tr></table></div></body></html>
|