Wednesday 12 August 2020

How To Display Output Message Like DBMS_OUTPUT.PUT_LINE In PostgreSQL Us...


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



How To Display Output Message Like DBMS_OUTPUT.PUT_LINE In Oracle Using PostgreSQL || Learn PL/pgSQL
How To Display Output Message Like DBMS_OUTPUT.PUT_LINE In PostgreSQL Using PgAdmin | Learn PL/pgSQL










-- The Purpose is to Display Message like DBMS_OUTPUT.PUT_LINE

-- of Oracle in PostgreSQL





CREATE OR REPLACE PROCEDURE public.proc(p_num1 IN numeric,p_num2 IN numeric)

LANGUAGE 'plpgsql'

AS $BODY$

DECLARE

v_sum numeric;

v_mult numeric;

v_div numeric;

BEGIN

v_sum := p_num1 + p_num2;

v_mult := p_num1 * p_num2;

BEGIN

v_div := TRUNC(p_num1/p_num2);

EXCEPTION WHEN OTHERS THEN

v_div := 0;

END;

RAISE NOTICE 'The Sum is : %',v_sum;

RAISE NOTICE 'The Multiplication is : %',v_mult;

RAISE NOTICE 'The Division is : %',v_div;



END;

$BODY$;



CALL public.proc(10,2);


No comments:

Post a Comment