I am trying to define a simple Standard SQL function where the input is multiplied by a constant defined inside the function.
CREATE or REPLACE FUNCTION Test(b FLOAT64)
RETURNS FLOAT64
AS
DECLARE var FLOAT64 = 0.5;
RETURN (b * var)
;
the syntax error is
Syntax error: Expected "(" or string literal but got keyword DECLARE
How do you define variables inside functions?