Reputation: 633
I made a simple function as part of my homework but for the life of me I can't figure out how to call it and test it. Can anyone tell me how?
-- Procedure
CREATE OR REPLACE FUNCTION addDoctor (
a INT,
b VARCHAR (20),
c VARCHAR (20)
) RETURNS VOID
LANGUAGE plpsql
AS $BODY$
BEGIN
INSERT INTO doctor
VALUES (a,b,c);
END;
$BODY$
Upvotes: 2
Views: 11485
Reputation: 41300
if you need to call function just to check for exceptions that can occur there go perform:
PERFORM f_foo(i);
if you need a result, go select
SELECT function_name();
Upvotes: 0
Reputation: 1
CREATE or REPLACE FUNCTION analyzer(character varying, character varying)
RETURNS boolean AS
$BODY$
--
begin
--
execute 'analyze '||quote_ident($1)||'.'||quote_ident($2) ;
return 1 ;
--
end ;
$BODY$
LANGUAGE plpgsql VOLATILE SECURITY DEFINER;
Upvotes: 0