Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. // creating function //
  2.  
  3. create or replace function dept_std(dept in varchar)
  4. return number IS
  5. total number(5):=0;
  6. BEGIN
  7. select total_students into total from dept_list dept_list where dept_name=dept;
  8.  
  9. return total;
  10. END;
  11. /
  12.  
  13. // end ////
  14.  
  15.  
  16.  
  17.  
  18. /* calling fuction */
  19.  
  20. declare
  21. c number(5);
  22. Begin
  23. c:=dept_std('CSE');
  24. dbms_output.put_line('Total no. of Students: ' || c);
  25. end;
  26. /
  27.  
  28. /*end */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement