Database Reference
In-Depth Information
The
SQL Worksheet
Connections
object
browser shows
connected databases
The
New Connection
button
The Cape Codd
database
The Cape Codd
database tables
The
Execute
button
The SQL query in the
SQL Worksheet
The
Results
tabbed window
Figure 2-18
Running an SQL Query in
Oracle SQL Developer
3.
Click the
Execute
button to run the query. The results are displayed in a results win-
dow, as shown in Figure 2-18.
Note that in Figure 2-18, the Cape-Codd-Database object in the Object Browser in the left
side Connection object browser of the Oracle SQL Developer has been expanded to show the
tables in the Cape Codd database. Many of the functions of SQL Developer are associated with
the objects in the Connections object browser and are often accessed by right-clicking the ob-
ject to display a shortcut menu.
By The Way
We are using Oracle Database 11
g
Release 2 running in Microsoft Server
2008 R2. When we give specific sequences of steps to follow in the text or
figures in this topic, we use the command terminology used by Oracle Database 11
g
Release 2 and associated utility programs in Microsoft Server 2008 R2. If you are run-
ning a workstation operating system such as Microsoft XP, Microsoft Vista, or Linux,
the terminology may vary somewhat.
Oracle Database 11
g
Release 2 is an enterprise-class DBMS product and, as is typical of
such products, does not store queries within the DBMS (it does store SQL Views, which can be
considered a type of query, and we will discuss SQL Views later in this chapter). However, you
can save queries as SQL script files. An
SQL script file
is a separately stored plain text file, and
it usually has a file name extension of
*.sql.
An SQL script can be opened and run as an SQL
command (or set of commands). Often used to create and populate databases, scripts can also
be used to store a query or set of queries. Figure 2-19 shows the SQL query being saved as an
SQL script.
Note that in Figure 2-19 the SQL scripts are shown in a folder named
{UserName}\
Documents\SQL Developer\DBP-e13-Cape-Codd-Database.
By default, Oracle SQL Developer
stores
*.sql
files in an obscure location within its own application files. We recommend that
you create a subfolder in your My Documents folder named
SQL Developer
and then create a
Search WWH ::
Custom Search