|
1 | 1 | <!-- |
2 | | -$Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.40 2001/10/26 21:17:03 tgl Exp $ |
| 2 | +$Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.41 2001/11/01 04:07:29 tgl Exp $ |
3 | 3 | --> |
4 | 4 |
|
5 | 5 | <chapter id="xfunc"> |
@@ -72,10 +72,13 @@ $Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.40 2001/10/26 21:17:03 tgl E |
72 | 72 |
|
73 | 73 | <para> |
74 | 74 | SQL functions execute an arbitrary list of SQL statements, returning |
75 | | - the results of the last query in the list. In the simple (non-set) |
| 75 | + the result of the last query in the list, which must be a |
| 76 | + <literal>SELECT</>. |
| 77 | + In the simple (non-set) |
76 | 78 | case, the first row of the last query's result will be returned. |
77 | | - (Bear in mind that <quote>the first row</quote> is not well-defined |
78 | | - unless you use <literal>ORDER BY</>.) If the last query happens |
| 79 | + (Bear in mind that <quote>the first row</quote> of a multi-row |
| 80 | + result is not well-defined unless you use <literal>ORDER BY</>.) |
| 81 | + If the last query happens |
79 | 82 | to return no rows at all, NULL will be returned. |
80 | 83 | </para> |
81 | 84 |
|
@@ -441,7 +444,8 @@ SELECT name, listchildren(name) FROM nodes; |
441 | 444 | (5 rows) |
442 | 445 | </screen> |
443 | 446 |
|
444 | | - Notice that no output row appears for Child2, Child3, etc. |
| 447 | + In the last SELECT, |
| 448 | + notice that no output row appears for Child2, Child3, etc. |
445 | 449 | This happens because listchildren() returns an empty set |
446 | 450 | for those inputs, so no output rows are generated. |
447 | 451 | </para> |
|