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
b4d7ea5f
Commit
b4d7ea5f
authored
Jul 26, 2010
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add table creation and population to example
from John Gage
parent
d017f835
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
doc/src/sgml/xfunc.sgml
doc/src/sgml/xfunc.sgml
+15
-2
No files found.
doc/src/sgml/xfunc.sgml
View file @
b4d7ea5f
<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.15
0 2010/07/25 08:30:42
petere Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.15
1 2010/07/26 20:14:05
petere Exp $ -->
<sect1 id="xfunc">
<sect1 id="xfunc">
<title>User-Defined Functions</title>
<title>User-Defined Functions</title>
...
@@ -861,10 +861,23 @@ SELECT * FROM getfoo(1) AS t1;
...
@@ -861,10 +861,23 @@ SELECT * FROM getfoo(1) AS t1;
output parameters, like this:
output parameters, like this:
<programlisting>
<programlisting>
CREATE TABLE tab (y int, z int);
INSERT INTO tab VALUES (1, 2), (3, 4), (5, 6), (7, 8);
CREATE FUNCTION sum_n_product_with_tab (x int, OUT sum int, OUT product int)
CREATE FUNCTION sum_n_product_with_tab (x int, OUT sum int, OUT product int)
RETURNS SETOF record AS $$
RETURNS SETOF record
AS $$
SELECT $1 + tab.y, $1 * tab.y FROM tab;
SELECT $1 + tab.y, $1 * tab.y FROM tab;
$$ LANGUAGE SQL;
$$ LANGUAGE SQL;
SELECT * FROM sum_n_product_with_tab(10);
sum | product
-----+---------
11 | 10
13 | 30
15 | 50
17 | 70
(4 rows)
</programlisting>
</programlisting>
The key point here is that you must write <literal>RETURNS SETOF record</>
The key point here is that you must write <literal>RETURNS SETOF record</>
...
...
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