Only 3.9% of viewers are subscribing to my channel 😓.
I request you to please give click on Subscribe button.
It really helps me grow 😢.
Overloading Of A Stored Procedure In PostgreSQL | Stored Procedure Overloading | PL/pgSQL Tutorials
CREATE TABLE public.testing(demo_column text);
CREATE OR REPLACE PROCEDURE public.testing_procedure(p_msg text)
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
BEGIN
INSERT INTO public.testing(demo_column) VALUES (p_msg);
END;
$BODY$;
CREATE OR REPLACE PROCEDURE public.testing_procedure(p_num1 numeric, p_num2 numeric)
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
v_result numeric;
BEGIN
v_result := p_num1+p_num2;
INSERT INTO public.testing(demo_column) VALUES ('The Sum is '||v_result);
END;
$BODY$;
CREATE OR REPLACE PROCEDURE public.testing_procedure(p_num1 numeric, p_num2 numeric,p_num3 numeric)
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
v_result numeric;
BEGIN
v_result := p_num1+p_num2 +p_num3;
INSERT INTO public.testing(demo_column) VALUES ('The Sum is '||v_result);
END;
$BODY$;
CALL public.testing_procedure('Hello Akram');
CALL public.testing_procedure(3,5);
CALL public.testing_procedure(3,5,67);
SELECT * FROM public.testing;
No comments:
Post a Comment