12345678910111213141516171819202122 |
- CREATE OR REPLACE FUNCTION scope() RETURNS integer AS $$
- << outerblock >>
- DECLARE
- quantity integer := 30;
- BEGIN
- RAISE NOTICE 'Quantity here is %', quantity;
- quantity := 50;
-
-
-
- DECLARE
- quantity integer := 80;
- BEGIN
- RAISE NOTICE 'Quantity here is %', quantity;
- RAISE NOTICE 'Outer quantity here is %', outerblock.quantity;
- END;
- RAISE NOTICE 'Quantity here is %', quantity;
- RETURN quantity;
- END;
- $$ LANGUAGE plpgsql;
|