Rahmadnet

PL/pgSQL variables

Jul 29th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DO $$
  2. declare
  3. /*
  4.  * -->counter is variable and integer is type data
  5.  * -->first_name is variable and varchar is type data
  6.  * -->last_name is variable and varchar is type data
  7.  * -->payment is variable and numeric is type data
  8.  */
  9.    counter    INTEGER := 1;
  10.    first_name VARCHAR(50) := 'Rahmad';
  11.    last_name  VARCHAR(50) := 'Nasution';
  12.    payment    NUMERIC(11,2) := 20.5;
  13. BEGIN
  14.    RAISE NOTICE '% % % has been paid % USD', counter, first_name, last_name, payment;
  15. END $$;
Advertisement
Add Comment
Please, Sign In to add comment