Sunday 9 August 2020

How To Create A Simple Stored Procedure In PostgreSQL And Call Using pgA...




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 😢.



-- purpose is to create a simple stored procedure in postgreSQL

-- and call it using pgAdmin





CREATE TABLE public.testing (demo_column text);





CREATE OR REPLACE PROCEDURE public.testing_procedure()

LANGUAGE 'plpgsql'

AS $BODY$

DECLARE

v_msg text;

BEGIN

v_msg := 'Hello Akram, We are watching Knowledge 360';



Insert into public.testing(demo_column) values (v_msg);

END;

$BODY$;





call public.testing_procedure();





SELECT * from public.testing;


No comments:

Post a Comment