I have the following function:
Create or Replace Function someFunction([parameter1], [parameter2]) Returns Integer As $$
Declare
someInt_ integer;
totalRows_ integer;
Begin
SELECT x INTO someInt_, COUNT(*) INTO totalRows_
FROM [table]
WHERE [some conditions];
[more code]
End;
$$ Language 'plpgsql';
The problem is that I get the following error:
ERROR: «count» is not a known variable
LINE 6: SELECT x INTO someInt_, COUNT(*) INTO totalRows_ ...
^
SQL state: 42601
Character: 181
How can I fix this?
I know a lot of data is missing, such as the return. It is because I have simplified it since the variables are in another language.