DO $$ DECLARE a integer := 10; b integer := 20; c integer; BEGIN c := a + b; RAISE NOTICE'Value of c: %', c; END $$; ----------------- CREATE FUNCTION getpersons() RETURNS SETOF person LANGUAGE plpgsql AS $$DECLARE overTheAgeOf int := 15; BEGIN RETURN QUERY SELECT * FROM person WHERE age > overTheAgeOf; END;$$; SELECT getpersons();
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter