skip to Main Content

vscode environment

I think I have created a stored procedure using the following:

CREATE FUNCTION select_all_employee_demographics()
RETURNS REFCURSOR
LANGUAGE plpgsql
AS $$
DECLARE
    cur REFCURSOR;
BEGIN
    OPEN cur FOR SELECT * FROM EmployeeDemographics;
    RETURN cur;
END;
$$;

Then I tried to delete the saved functions using the following:

DROP FUNCTION get_employee_demographics(refcurser);
DROP FUNCTION select_all_employee_demographics;

But I get the following errors:

"could not find a function named "select_all_employee_demogrphics"

Please also see attached image of my environment.

Please let me know if i need to specify further.

2

Answers


  1. Chosen as BEST ANSWER
     DROP PROCEDURE IF EXISTS public.select_all_employee_demographics(refcursor);
    

    This piece of code worked, specific to my issue.

    Thank you all for helping - appreciate it


  2. Try to drop the function without inputs, like this:

    DROP FUNCTION select_all_employee_demographics();
    

    references: PostgreSQL Drop Function

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search