EMPLO YEE. You can then use the following
SELECT first_name, last_name, hire_date
and drop a table name from the TABLES
node in the Connections Navigator into
the SQL Worksheet. This action automati-
cally creates an editable SELECT statement
in the SQL Worksheet whose select list
includes all the columns in the table. Figure
1 shows the result of dragging and dropping
the EMPLOYEE table into the Oracle SQL
Developer SQL Worksheet.
The SELECT list in the above statement
specifies three columns—listing the first
name, last name, and date of hire for every
employee contained in the EMPLOYEE
table, which is specified in the FROM clause.
(To specify multiple columns in a SELECT
list, you separate the column names with
commas; a good practice is to insert a space
after each comma for readability.)
When the above statement is executed,
the result set is a list of all the values found
in the first_name, last_name, and hire_date
columns of the EMPLO YEE table, as shown
in Listing 1.
Figure 1: Result of dragging and dropping the EMPLO YEE table into the SQL Worksheet
Figure 2: The SQL Worksheet icon tool bar
EVERY THING WI TH A MERE
If you want to display all the columns for
a particular table, you can use the asterisk
(*) wildcard character as the SELECT list
instead of typing the name of every column.
Figure 3: The Results tab in the SQL Worksheet
When this statement executes, the result
set displays the columns in the order in
which they are defined in the table, as shown
in Listing 2.
This is the same column order you see
when you issue the DESCRIBE command (or
when you click the Columns tab in Oracle
SQL Developer), as shown in Listing 3.
You should use the asterisk wildcard
character primarily for ad hoc querying—
when you want an answer from the database that you have not already asked for
via programmatic code. When you include
SELEC T statements in programmatic blocks
of code (which you’ll learn about in subsequent articles in this series), it is a good
practice to list your columns of interest by
name in your SELEC T lists.
Figure 4: The Script Output tab in the SQL Worksheet
SELEC T WI TH ORACLE SQL DEVELOPER
In Oracle SQL Developer, an easy way to
construct a SELEC T statement is to drag