Write a function accept the movie name as input and prints its release year and budget

Write a function which will accept the movie name as input and prints its release year and budget. 






 








Write a function which will accept the movie name as input and prints its release year and budget. 

ANS--->>>>>

create or replace function shaikh3(m varchar(20)) returns int as

'

declare


r1 movie%rowtype;

ch int := 0;


begin


for r1 in select * from movie where mname = m


loop

      

    raise notice ''  %   %  '',r1.ryear,r1.budget;


end loop;


return ch;



end;


'language'plpgsql';


Out put of function

 select act('dddd');



o\p

NOTICE:  1 Dnagal  

NOTICE:  2 Sultan  

NOTICE:  3 KGF  

NOTICE:  4 bahubali  

NOTICE:  5 THE social network  


Post a Comment

0 Comments