mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 00:03:57 -04: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 | ||||
| --	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 | ||||
| -- function that removes employees with negative salaries. | ||||
| -- | ||||
| -- SELECT * FROM EMP; | ||||
| -- | ||||
| -- CREATE FUNCTION clean_EMP () RETURNS integer | ||||
| --	  AS 'DELETE FROM EMP WHERE EMP.salary <= 0; | ||||
| --		  SELECT 1 AS ignore_this' | ||||
| --	  LANGUAGE SQL; | ||||
| -- | ||||
| -- SELECT clean_EMP(); | ||||
| -- | ||||
| -- SELECT * FROM EMP; | ||||
| 
 | ||||
| SELECT * FROM EMP; | ||||
| 
 | ||||
| CREATE FUNCTION clean_EMP () RETURNS integer | ||||
|    AS 'DELETE FROM EMP WHERE EMP.salary <= 0; | ||||
|        SELECT 1 AS ignore_this' | ||||
|    LANGUAGE SQL; | ||||
| 
 | ||||
| SELECT clean_EMP(); | ||||
| 
 | ||||
| SELECT * FROM EMP; | ||||
| 
 | ||||
| 
 | ||||
| ----------------------------- | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user