Advertisement
alexarcan

lab9_DBD_classTask_working

Nov 21st, 2016
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. --1)
  2. SET SERVEROUTPUT ON
  3. DECLARE
  4. message varchar2(20):= 'Hello, World!';
  5. BEGIN
  6. dbms_output.put_line(message);
  7. END;
  8.  
  9. --2)
  10. CREATE OR REPLACE FUNCTION TINC
  11. (
  12. NAME_IN IN VARCHAR2
  13. ) RETURN VARCHAR2 AS
  14. total_val NUMBER(20);
  15. BEGIN
  16. total_val := 0;
  17.  
  18. FOR emp in (SELECT income FROM employee WHERE name = name_in)
  19. LOOP
  20. total_val := total_val + emp.income;
  21. END LOOP;
  22. RETURN total_val;
  23. END TINC;
  24. /
  25.  
  26. set serveroutput on;
  27. declare
  28. income varchar2(20);
  29. BEGIN
  30. dbms_output.put_line(TINC('B'));
  31. END;
  32. /
  33.  
  34. --3)
  35. set serveroutput on;
  36. create or replace
  37. PROCEDURE computeTotalIncome
  38. AS
  39. BEGIN
  40. dbms_output.put_line(TINC('B'));
  41. END;
  42.  
  43. BEGIN
  44. computeTotalIncome();
  45. END;
  46. /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement