Introduction to Graphics Builder
Introduction
Graphics
Builder lets you to create interactive
graphical displays of the data in a
database. You can include these graphics in
your forms or reports. Graphics Builder
provides a complete set of drawing and
editing tools, along with a �Chart Wizard�
to simplify the process of using the tools.
Hands-On
In this
Hands-On, you learn how to: Create a chart,
Write a query, Execute a query, Modify a
query, and Save a chart. You will create a
chart to show a salary distribution in each
department.
Open Graphics
Builder tool
Open the
�Graphics Builder� tool and create a chart
to show a salary distribution in each
department.
When you open
the �Graphics Builder� tool, the �Object
Navigator� and �Graphics: Disp1: Layout
Editor� window will be opened.
You can open
the database if you click on the database
object. If you don�t open the database the
�Graphics Builder� tool will force you to
enter your userid, password, and database
name.
Create a chart
In the
�Graphics: Layout Editor� window, on the
left vertical tool bar, click on the "chart�
icon. To know which icon is the �Chart�
icon, drag the cursor on any icon and a
tooltip displays the icon function.
Drag the
cursor and click anywhere on the �layout
editor.� A �+� sign will be displayed on the
�Layout Editor� window. Drag it anywhere
that you want to see the chart and click the
mouse to display the �Chart Genie - New
Query� window.
SQL statement
In the �Chart
Genie - New Query� window, type the query
name and write a query to show the total
salaries paid for each department in the
�SQL statement� box.
(SQL Statement
box)
SELECT deptno,
sum(sal) totals
FROM emp
GROUP BY
deptno
Click on the
"Execute" button. If you didn�t login to the
database, you will get the �Connect� window
to login.
Login as
oracle password �learning� then click
�CONNECT.�
In the �Data�
tab in the �Chart Genie� window, check the
query output and click �OK.�
In the �Chart�
tab in the �Chart Properties� window type
the chart�s name (c_dept_sal) and it's title
(Salary Distributions). Select the type and
subtype and then click �OK.�
Display a
chart
You should see
the chart. As you can see the department
numbers are not meaningful and you should
change them to department name a more
meaningful title.
Modify a chart
To change the
department number to department name, click
on the �SQL� icon on the �Queries� item in
the �Object Navigator� window. The �Query
Properties� window will be displayed.
Join the
employee table with the department table and
add the department name to the query.
(SQL Statement
box)
SELECT dname,
sum(sal) totals
FROM emp e,
dept d
WHERE d.deptno
= e.deptno
GROUP BY dname
Click �OK.�
You should get
the following message:
Column
�DEPTNO� specified in chart your-chart-name
not found
Delete missing
columns from chart?
Click �Yes,�
to remove the department number from the
chart.
Now, this
chart is much easier to understand, than the
previous chart.
Save a chart
Save the chart
in the �oracle� folder using the �file
system� option. You can also save the chart
object in the database. Save the chart (c:\_sal).
Questions:
Q:
How can you create a chart using the
"Graphics Builder" tool?
Q:
How can you
run a query against a chart?
Q:
How can you modify a query?
Q:
How can you save a query? |