Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdce6249

Browse files
committed
Doc, more or less: uncomment tutorial example that was fixed long ago.
Reverts a portion of commit344190b. Apparently, back in thetwentieth century we had some issues with multi-statement SQLfunctions, but they've worked fine for a long time.Daniel WestermannDiscussion:https://postgr.es/m/GVAP278MB04242DCBF5E31F528D53FA18D2A90@GVAP278MB0424.CHEP278.PROD.OUTLOOK.COM
1 parent93c39f9 commitdce6249

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)

[8]ページ先頭

©2009-2025 Movatter.jp