Skip to content

Commit dce6249

Browse files
committed
Doc, more or less: uncomment tutorial example that was fixed long ago.
Reverts a portion of commit 344190b. Apparently, back in the twentieth century we had some issues with multi-statement SQL functions, but they've worked fine for a long time. Daniel Westermann Discussion: https://postgr.es/m/GVAP278MB04242DCBF5E31F528D53FA18D2A90@GVAP278MB0424.CHEP278.PROD.OUTLOOK.COM
1 parent 93c39f9 commit dce6249

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/tutorial/funcs.source

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,24 +99,21 @@ SELECT name(high_pay()) AS overpaid;
9999
-----------------------------
100100
-- Creating SQL Functions with multiple SQL statements
101101
-- you can also create functions that do more than just a SELECT.
102-
--
103-
-- 14MAR99 Clark Evans: Does not quite work, commented out for now.
104-
--
105102
-----------------------------
106103

107104
-- you may have noticed that Andy has a negative salary. We'll create a
108105
-- function that removes employees with negative salaries.
109-
--
110-
-- SELECT * FROM EMP;
111-
--
112-
-- CREATE FUNCTION clean_EMP () RETURNS integer
113-
-- AS 'DELETE FROM EMP WHERE EMP.salary <= 0;
114-
-- SELECT 1 AS ignore_this'
115-
-- LANGUAGE SQL;
116-
--
117-
-- SELECT clean_EMP();
118-
--
119-
-- SELECT * FROM EMP;
106+
107+
SELECT * FROM EMP;
108+
109+
CREATE FUNCTION clean_EMP () RETURNS integer
110+
AS 'DELETE FROM EMP WHERE EMP.salary <= 0;
111+
SELECT 1 AS ignore_this'
112+
LANGUAGE SQL;
113+
114+
SELECT clean_EMP();
115+
116+
SELECT * FROM EMP;
120117

121118

122119
-----------------------------

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