Datasheet

SQL Fundamentals
9
SELECT 800 400 FROM dual
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
SQL>
You need to put the hyphen in the next line for the query to succeed:
SQL> SELECT 800
2 - 400 FROM dual;
800-400
----------
400
SQL>
Getting Information with the DESCRIBE Command
You can use the DESCRIBE command to get information about the database objects. Using
DESCRIBE on a table or view shows the columns, its datatypes, and whether each column
can be
NULL. Using DESCRIBE on a stored program such as procedure or function shows
the parameters that need to be passed in/out, their datatype, and whether there is a default
value. You can abbreviate this command to the first four characters or more
DESC, DESCR,
and
DESCRIB are all valid.
If youre connected to the
HR schema and need to see the tables and views in this schema,
use the following query:
SQL> SELECT * FROM tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
COUNTRIES TABLE
DEPARTMENTS TABLE
EMPLOYEES TABLE
EMP_DETAILS_VIEW VIEW
JOBS TABLE
JOB_HISTORY TABLE
LOCATIONS TABLE
REGIONS TABLE
8 rows selected.
SQL>
95127c01.indd 9 2/18/09 6:37:07 AM