PL/SQL Query

15 pts.
Tags:
PL/SQL
PL/SQL Multiple Session
SQL Query
SQL tables
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    Please post the error message you are getting, and if possible post your code again using the editor's "code" tool.
    69,065 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following