Skip to Main Content

Oracle Database Express Edition (XE)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Generate a report using procedure with cursor ( ORACLE - PL/SQL)

User_LM22YAug 26 2021 — edited Aug 26 2021

Hey Guys, im planning to generate a report using stored procedure with cursor(if possible) to display the completed journey for top most desired to reached location which is (ToDestination) within my table, i just dont know how please help, thank you

Here is my table (Table Name : Booking)
Tableforstack.PNG
I want to display something like this
SQL> exec summary_report;

=============================================================
Summary Report for top desired to reach location by customer
=============================================================
==================================================================
|Journey Status  |   Desired Location  | Desired Location (COUNT) |
==================================================================
    COMPLETED        Pahang                     3    
    COMPLETED        Perak                      3   
    COMPLETED        Selangor                   1   
    COMPLETED        Perlis                     1  
    COMPLETED        Johor                      1    
    COMPLETED        Kelantan                   1  

=============================================================
             END OF REPORT
=============================================================

Comments

843807
It means that g was probably not initialized.. you can quickly check this by commenting out that g.drawImage line and put an if statement to check if g is null or not.. chances are you will find that it is null.. then you'll have to figure out why it is null..
843807
Right, g (a Graphics object) is null. What is it supposed to equal? The reference books just show the paint method and the g.drawImage() but they don't set g to anything.

Thanks,
Shawn
843807
Also... since you're using an applet, try not to use Toolkit as it is usually used for applications. Also, to make 'g' not null, just use it in your paint method like so:
import java.applet.*;
import java.awt.*;
public class Example extends Applet {
	Image splashImage;
	public void init() {
		splashImage = getImage(getCodeBase(),"R2Splash.gif");
	}
	public void paint(Graphics g) {
		g.drawImage(splashImage,30,40,null);
	}
}
843807
Thanks for the help. Unfortunately, I received the same exception at the same line. I understand that Applets automatically use the Paint(), but in this case, how is it accessing the paint() before the init() and setting the value of g? I just think it's stopping before it gets to that method.

Shawn
843807
Applets automatically use the Paint(), but in this
case, how is it accessing the paint() before the
init() and setting the value of g? I just think it's
stopping before it gets to that method.

Shawn
You don't use g.drawImage() in init(), you use it in paint(). Try using the exact code I gave you, and you'll see.
1 - 5

Post Details

Added on Aug 26 2021
1 comment
438 views