Create table other_sess( s_name varchar2(10)); insert into other_sess values('s2007'); insert into other_sess values('s2009'); insert into other_sess values('s2009'); commit; now i want to write a PL to retrive data from these sessions (s2007, s2008, s2009). from my current session. declare mold_session varchar2(10); cursor c1 is select s_name from other_sess order by s_name; begin open C1; loop fetch c1 into mold_session; exit when c1%notfound; declare mtotal_sale number(16,2); cursor c2 is select nvl(sum(total_sale),0) from mold_session.sale_table; begin open c2; fetch c2 into mtotal_sale; close c2; dbms_output.put_line('Total Sale of '||mold_session||'= '||mtotal_sale; end; end loop; close C1; end; but its shows error....... Please Help me.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!