Database Reference
In-Depth Information
Figure 1.14
Log into Your
Database as a
Valid User.
an SQL> prompt telling you that SQL*Plus is ready to accept
commands.
4.
Type the following command and press Enter. This is an
SQL*Plus command that tells the database to list the structure of
the table or view that you name. A view is a query stored with a
name in the database. It acts like a table but does not store any
data. (Chapter 19 covers views in detail).
DESC DBA_USERS
5.
The screen shows the names and datatypes of all the columns in
this view. This is very useful when you are about to write an SQL
command and you need a quick reminder of the exact column
names in a table. Now type this query and press Enter after each
line. Notice that the prompt changed from “SQL>” to “2” on the
second line. This indicates that SQL*Plus knows you have started
a command and you are continuing it on the next line. The semi-
colon at the end of the second line signals to SQL*Plus that the
command is complete and should be immediately executed.
SELECT USERNAME, ACCOUNT_STATUS, CREATED
FROM DBA_USERS;
6.
The results scroll by, and you can use the scroll bar on the right
side of the window to move up or down and view the results. Fig-
ure 1.15 shows the results from the query. The column headings
 
Search WWH ::




Custom Search