I am trying to create a stored procedure via pgadmin4. I have a actors table with one of the columns being gender with the data type as character either M or F, so what I want to create is stored procedure where I supply the gender as a single char 'M' or 'F'
This is my code:
CREATE or replace PROCEDURE actorGender(sex character)
language plpgsql
as $$
begin
select * from actors where gender = sex;
end;$$
call actorGender('M')
But I get the following error:
ERROR: query has no destination for result data HINT: If you want to discard the results of a SELECT, use PERFORM instead. CONTEXT: PL/pgSQL function actorgender(character) line 3 at SQL statement SQL state: 42601