Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // creating function //
- create or replace function dept_std(dept in varchar)
- return number IS
- total number(5):=0;
- BEGIN
- select total_students into total from dept_list dept_list where dept_name=dept;
- return total;
- END;
- /
- // end ////
- /* calling fuction */
- declare
- c number(5);
- Begin
- c:=dept_std('CSE');
- dbms_output.put_line('Total no. of Students: ' || c);
- end;
- /
- /*end */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement