Cover | Table of Contents
sqlplus [[-S[ILENT]] [-R[ESTRICT] level] [-M[ARKUP] markup_options] [username[/password][@connect]|/|/NOLOG] [@scriptfile [arg1 arg2 arg3...]]] | - | -?
SELECT column_list FROM table_list WHERE conditions GROUP BY column_list HAVING conditions ORDER BY column_list;
SELECT table_name, tablespace_name FROM user_tables;
SELECT table_name, tablespace_name FROM user_tables ORDER BY table_name;
ORDER BY table_name DESC;
SELECT table_name, tablespace_name
FROM user_tables
ORDER BY tablespace_name DESC,
table_name ASC;
SELECT table_name, tablespace_name FROM user_tables ORDER BY UPPER(table_name);
COLUMN employee_name HEADING "Employee Name"
Employee Name -------------
|) character to specify the location of the line
break. For example:COLUMN employee_name HEADING "Employee|Name"
Employee Name ---------
COLUMN employee_name HEADING "Employee|Name" - JUSTIFY RIGHT COLUMN employee_name HEADING "Employee|Name" - JUSTIFY CENTER
SET LINESIZE 60
SQL> @e:\oracle\ora81\rdbms\admin\utlxplan Table created.
Name Null? Type ------------------------ -------- ---- STATEMENT_ID VARCHAR2(30) TIMESTAMP DATE REMARKS VARCHAR2(80) OPERATION VARCHAR2(30) OPTIONS VARCHAR2(30) OBJECT_NODE VARCHAR2(128) OBJECT_OWNER VARCHAR2(30) OBJECT_NAME VARCHAR2(30) OBJECT_INSTANCE NUMBER(38) OBJECT_TYPE VARCHAR2(30) OPTIMIZER VARCHAR2(255) SEARCH_COLUMNS NUMBER ID NUMBER(38) PARENT_ID NUMBER(38) POSITION NUMBER(38) COST NUMBER(38) CARDINALITY NUMBER(38) BYTES NUMBER(38) OTHER_TAG VARCHAR2(255) PARTITION_START VARCHAR2(255) PARTITION_STOP VARCHAR2(255) PARTITION_ID NUMBER(38) OTHER LONG DISTRIBUTION VARCHAR2(30)
|
Format
Element |
Function |
|---|---|
|
9 |
Represents a digit in the output. |
|
0 |
Marks the spot at which you want to begin displaying leading zeros. |
|
$ |
Includes a leading dollar sign in the output. |
|
, |
Places a comma in the output. |
|
. |
Marks the location of the decimal point. |
|
B |
Forces zero values to be displayed as blanks. |
|
MI |
Adds a trailing negative sign to a number and may be used only at the
end of a format string. |
|
S |
Adds a + or - sign to the number and may be
used at either the beginning or end of a format string. |
|
PR |
Causes negative values to be displayed within angle brackets. For
example, -123.99 will be displayed as <123.99>. |
|
D |
Marks the location of the decimal point. |
|
G |
Places a group separator (usually a comma) in the output. |
|
C |
Marks the place where you want the ISO currency indicator to appear.
For U.S. dollars, this will be USD. |
|
L |
Marks the place where you want the local currency indicator to
appear. For U.S. dollars, this will be the dollar sign character. |
|
V |
Displays scaled values. The number of digits to the right of the V
indicates how many places to the right the decimal point is shifted
before the number is displayed. |
|
EEEE |
Causes SQL*Plus to use scientific notation to display a value. You
must use exactly four Es, and they must appear at the right end of
the format string. |
|
RN |
Allows you to display a number using Roman numerals. An uppercase RN
yields uppercase Roman numerals, while a lowercase rn yields
lowercase Roman numerals. Numbers displayed as Roman numerals must be
integers and must be between 1 and 3,999, inclusive. |
|
DATE |
Causes SQL*Plus to assume that the number represents a Julian date
and to display it in MM/DD/YY format. |
/* SQL*Plus script written 7-Jan-2000 by Jonathan Gennick. */
--Written 7-Jan-2000 by Jonathan Gennick
@$ORACLE_HOME/rdbms/admin/utlxplan @add_user "TINA" "SECRETPASSWORD"
@@generate_emp_report @@generate_pay_history_report '101'
SQL> SELECT * FROM dual 2 SQL> D - X
ACCEPT user_password CHAR - PROMPT "Password: " HIDE ACCEPT id NUMBER FORMAT "999.99" ACCEPT report_date DATE - PROMPT "Date: " FORMAT "dd-mon-yyyy"
Return to Oracle SQL*Plus Pocket Reference