when to use dynamic sql rather than static sql

if answer is

in static sql one hve a fixed sql statement but where in dynamic sql u can build sql statements as charecter string at run time

den wat is the difference between ref cursor and dynamic sql