I am just moving to some PostgreSQL from MS-SQL and have checked numerous pages on how to use variables in a script but am getting nowhere
Within pg-admin I have my database and have a new script. I have stripped the SQL right back to a single line as follows:
DECLARE v_syncId integer;
Running this script gives me:
ERROR: syntax error at or near "integer"
LINE 1: DECLARE v_syncId integer;
^
SQL state: 42601
Character: 18
I am obviously doing something wrong here but can't see what
What I have tried:
I have tried setting default values but no luck (same error)
DECLARE v_syncId integer DEFAULT 50;
DECLARE v_syncId integer = 50;
Both give the same error
I have tried other data types:
DECLARE v_syncId VARCHAR;
and also same result.
Any references here would be appreciated.