execute block
returns (i int)
as
declare function f(x int) returns int
as
-- declare u int = x + 1;
begin
return x + 1;
end
declare g int = f(1);
begin
i = g;
suspend;
end
If you remove the comment inside declare function f(x int), you will get an error:
Column does not belong to referenced table.
Dynamic SQL Error.
SQL error code = -206.
Column unknown.
"X".
At line 6, column 21.
-------------------------------------------
SQLCODE: -206
SQLSTATE: 42S22
GDSCODE: 335544569
If you remove the comment inside
declare function f(x int), you will get an error: