File tree 1 file changed +11
-14
lines changed
1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -99,24 +99,21 @@ SELECT name(high_pay()) AS overpaid;
99
99
-----------------------------
100
100
-- Creating SQL Functions with multiple SQL statements
101
101
-- 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
- --
105
102
-----------------------------
106
103
107
104
-- you may have noticed that Andy has a negative salary. We'll create a
108
105
-- 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;
120
117
121
118
122
119
-----------------------------
You can’t perform that action at this time.
0 commit comments