mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
Doc, more or less: uncomment tutorial example that was fixed long ago.
Reverts a portion of commit 344190b7e. 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
This commit is contained in:
parent
93c39f987e
commit
dce6249081
@ -99,24 +99,21 @@ SELECT name(high_pay()) AS overpaid;
|
|||||||
-----------------------------
|
-----------------------------
|
||||||
-- Creating SQL Functions with multiple SQL statements
|
-- Creating SQL Functions with multiple SQL statements
|
||||||
-- you can also create functions that do more than just a SELECT.
|
-- you can also create functions that do more than just a SELECT.
|
||||||
--
|
|
||||||
-- 14MAR99 Clark Evans: Does not quite work, commented out for now.
|
|
||||||
--
|
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
-- you may have noticed that Andy has a negative salary. We'll create a
|
-- you may have noticed that Andy has a negative salary. We'll create a
|
||||||
-- function that removes employees with negative salaries.
|
-- function that removes employees with negative salaries.
|
||||||
--
|
|
||||||
-- SELECT * FROM EMP;
|
SELECT * FROM EMP;
|
||||||
--
|
|
||||||
-- CREATE FUNCTION clean_EMP () RETURNS integer
|
CREATE FUNCTION clean_EMP () RETURNS integer
|
||||||
-- AS 'DELETE FROM EMP WHERE EMP.salary <= 0;
|
AS 'DELETE FROM EMP WHERE EMP.salary <= 0;
|
||||||
-- SELECT 1 AS ignore_this'
|
SELECT 1 AS ignore_this'
|
||||||
-- LANGUAGE SQL;
|
LANGUAGE SQL;
|
||||||
--
|
|
||||||
-- SELECT clean_EMP();
|
SELECT clean_EMP();
|
||||||
--
|
|
||||||
-- SELECT * FROM EMP;
|
SELECT * FROM EMP;
|
||||||
|
|
||||||
|
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user