Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
TravisO
Creating a variable in SQL syntax problem?
I'm just trying to do the most simplest of tasks, just create a variable in a postgres function, but even after scanning the manual, I still can't see what's wrong with this basic syntax:
BEGIN
DECLARE from_id INT DEFAULT 50;
DECLARE from_hall INT DEFAULT 4;
DECLARE to_hall INT DEFAULT 8;
DECLARE is_exists INT;
END;
The pgAdmin complains right at the first DECLARE with:
ERROR: syntax error at or near "DECLARE"
What simple typo am I making here?
You can even scan the manual yourself at:
3 AnswersProgramming & Design1 decade ago