Sie sind auf Seite 1von 18

Oracle SQL*Plus Commands

Report Development

SQL*Plus - Table Of Contents


∗Interacting with SQL*Plus
∗Continuation character
∗Entering SQL Statements
∗Strings in SQL*Plus Commands
∗Specifying File Names
∗Formatting Text Reports
∗Column Heading
∗Multi-line Heading
∗Alignment of Column Heading
∗Column Formats
∗Page Width and Length

SQL*Plus - Table Of Contents -2


∗Page Headers and Footers
∗Defining a BOTTOM title: BTITLE
∗Getting date into a title
∗Report Header
∗Page Breaks
∗Report Breaks
∗Specifying multiple break for a report
∗The COMPUTE command
∗SQL*Plus FORMAT ELEMENTS
∗Sample Reports
∗More commands

Interacting with SQL*Plus


∗ SQL*Plus was Oracle's original report-writing tool, and it has retained its report writing
capabilities.
∗There are many other tools that can be used to create Oracle report, but they may not be
available to you.
∗If other tools are not available, you can always use the tools explained here to produce
report.
Interacting with SQL*Plus
∗Commands such as DESC[RIBE], SET, COL[UMN] are specific to SQL*Plus editor.
∗They should entered on one line and is executed immediately.
∗SQL*Plus commands may optionally be terminated by a semicolon.
∗semicolon may be changed to something else by SQLTERMINATOR command.

SQL*Plus - Continuation character


∗Use hyphen '-' as continuation character for long SQL*Plus command
∗When you continue a quoted string, the line break counts as one space.

SELECT 'Hello -
World!!!'
FROM DUAL;

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.1
/* Practice 1: Modify the above command to produce the following results */
MESSAGE
--------------
Hello World!!!

SQL*Plus: Entering SQL Statements


∗SQL statements may span multiple lines
∗SQL statements must always be terminated.
∗termination is by semicolon';' or forward slash'/'
∗In both cases, they are entered into a buffer known as SQL buffer.
∗Terminator symbol may be changed to something else by SQLTERMINATOR command.
∗To execute a statement currently in the buffer, enter a forward slash

SET SQLTERMINATOR '='


SELECT '= new terminator ' as "new terminator"
FROM DUAL=

/* Practice 2: change the terminator back to semicolon */

Strings in SQL*Plus Commands


∗Simple strings containing spaces or punctuation character may be entered without quotes
(single or double).
∗To embed a quote in the string, either double them or use a different enclosing quote.

column quoted_heading HEADING "Oracle's World!"


SELECT 'use quote in Heading' quoted_heading
FROM DUAL;

Oracle's World!
--------------------
use quote in Heading

Specifying File Names


You may run a file or spool a file. The extension of a file depends on the command

run a:\format.sql
spool a:\command_file
spool off
/

Specifying File Names


/* Practice 3:
a. Create spool file called file1
b. Create a command file (Myfile) with extension .sql
c. Enter several SQL statements
d. Run your command file from SQL*Plus
e. Turn off the spool file
f. Examine your spool file */

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.2
Formatting Text Reports
SQL*Plus allows you to define:
-- column heading
-- display formats for each column
-- page headers and footers
-- page and line breaks
-- summary calculation such as total and subtotal

Column Heading
Specify column heading using the HEADING clause of the COLUMN command

COLUMN fname HEADING "First Name"


SELECT *
FROM employee;

Multi-line Heading
To specify multi-line heading use the vertical bar '|'character

COLUMN fname HEADING "First|Name"


COLUMN lname HEADING "Last|Name"
SELECT *
FROM employee;

Single and Multi-line Heading


/* Practice 4: Specify new headings for the following columns

a. commission ==> Commission


b. DOB ==> Date Of Birth (in two lines)
c. branch_no ==> BNO
d. employee_no ==> Employee No (in two lines) */

Alignment of Column Heading


Use JUSTIFY command to alter the behavior

COLUMN fname HEADING "First|Name" JUSTIFY RIGHT


COLUMN lname HEADING "Last|Name" JUSTIFY CENTER
COLUMN DOB JUSTIFY CENTER
SELECT *
FROM employee;

SELECT employee_no, fname, lname, dob, commission, branch_no


FROM employee;
First Last
EMPLOYEE_NO Name Name DOB COMMISSION BRANCH_NO
----------- ------------ ------------ --------- ---------- ---------
1001 JUSTIN GRIFFIN 01-JAN-78 50 7001
1002 KEITH DIAZ 02-FEB-61 50 7002
1003 SAMUEL HAYES 03-MAR-42 50 7003
1004 WILLIE MYERS 04-APR-83 100 7004
1005 RALPH FORD 05-MAY-64 80 7005
1006 MARY HAMILTON 06-JUN-75 50 7006
1007 PATRICIA GRAHAM 07-JUL-54 70 7007

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.3
...
25 rows selected.

Column Formats
∗You can specify display formats with the FORMAT clause of the COLUMN command.

∗The later section "SQL*Plus Format Elements" shows how to format different types of data.
Page Width and Length
Page Width and Length
∗Page width is controlled by SET LINESIZE command. The default length is 80 characters.

SET LINESIZE 60
SELECT *
FROM employee;

-- The above change will cause line wrapping. Let change it back to 80.

Page Length
Page length is controlled by the SET PAGESIZE command.
∗Specifies the number of lines per page of output.
∗The default is set print 24 lines.
∗The printed lines includes the page header and footer lines.
∗Setting PAGESIZE to zero has special meaning in SQL*PLUS.
∗A PAGESIZE of zero will not print page header and footer, and column headings.

Page Headers
Defining a TOP Title (TTITLE) through an example.

∗In the first line: the "company name" will be left justified, the word "Current" will be
centered, the page number will be right justified.

∗In the second Line: the word "Employee Listing will be centered, the final skip clause (SKIP
4) provides three blank lines between the page title and the column headers.

Page Headers - Example


SET LINESIZE 85
TTITLE LEFT "My Company" CENTER "CURRENT" -
RIGHT "Page" FORMAT 999 SQL.PNO SKIP 1 -
CENTER "Employee Listing" SKIP 3
COLUMN lname HEADING "Last Name" JUSTIFY CENTER
COLUMN fname HEADING "First Name" JUSTIFY CENTER
SELECT employee_no, fname, lname, dob, commission, branch_no
FROM employee;

Defining Top Title: TTITLE


SQL> SET LINESIZE 85
SQL> TTITLE LEFT "My Company" CENTER "CURRENT" -
> RIGHT "Page" FORMAT 999 SQL.PNO SKIP 1 -
> CENTER "Employee Listing" SKIP 3
SQL> COLUMN lname HEADING "Last Name" JUSTIFY CENTER
SQL> COLUMN fname HEADING "First Name" JUSTIFY CENTER
SQL> SELECT employee_no, fname, lname, dob, commission, branch_no
2 FROM employee;

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.4
My Company CURRENT Page 1
Employee Listing

EMPLOYEE_NO First Name Last Name DOB COMMISSION BRANCH_NO


----------- -------------- -------------- --------- ---------- ---------
1001 JUSTIN GRIFFIN 01-JAN-78 50 7001
1002 KEITH DIAZ 02-FEB-61 50 7002
1003 SAMUEL HAYES 03-MAR-42 50 7003
1004 WILLIE MYERS 04-APR-83 100 7004
1005 RALPH FORD 05-MAY-64 80 7005
1006 MARY HAMILTON 06-JUN-75 50 7006
...
25 rows selected.

Defining a BOTTOM title: BTITLE


The same clauses will work in the BTITLE command to define page footers.

SET LINESIZE 85
TTITLE LEFT "My Company" CENTER "CURRENT" -
LEFT "Report Date: " report_date SKIP 1 -
CENTER "Employee Listing" SKIP 3
BTITLE LEFT " Report is developed by Cyrus Azarbod" -
RIGHT "Page" FORMAT 999 SQL.PNO
COLUMN lname HEADING "Last Name" JUSTIFY CENTER
COLUMN fname HEADING "First Name" JUSTIFY CENTER

SELECT employee_no, fname, lname, dob, commission, branch_no


FROM employee;

CLEAR COLUMN
TTITLE OFF
BTITLE OFF

Defining a BOTTOM title: BTITLE - example

Report Date: report_date CURRENT


Employee Listing

EMPLOYEE_NO First Name Last Name DOB COMMISSION BRANCH_NO


----------- -------------- -------------- --------- ---------- ---------
1001 JUSTIN GRIFFIN 01-JAN-78 50 7001
1002 KEITH DIAZ 02-FEB-61 50 7002
1003 SAMUEL HAYES 03-MAR-42 50 7003
1004 WILLIE MYERS 04-APR-83 100 7004
1005 RALPH FORD 05-MAY-64 80 7005
1006 MARY HAMILTON 06-JUN-75 50 7006
1007 PATRICIA GRAHAM 07-JUL-54 70 7007
1008 LINDA SULLIVAN 08-AUG-56 60 7008
1009 BARBARA JONES 09-SEP-68 50 7009
1010 ELIZABETH BROWN 10-OCT-81 100 7010

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.5
1011 JENNIFER DAVIS 11-NOV-72 100 7011
1012 MARIA MILLER 12-DEC-69 100 7012

Report is developed by Cyrus Azarbod Page 1

Getting date into a title


1. Get the date into a user variable
2. Place the user variable into your BTITLE and TTITLE command.

COLUMN curdate NEW_VALUE report_date


SELECT TO_CHAR(SYSDATE, 'dd-Mon-yyy') curdate
FROM DUAL;

CURDATE
----------
28-Feb-003
∗After executing the commands shown in the above, the date will be in a user variable
named "report_date".

COLUMN curdate NEW_VALUE report_date


BTITLE LEFT "Report Date: " report_date
SELECT TO_CHAR(SYSDATE, 'dd-Mon-yyy') curdate
FROM DUAL;

CURDATE
----------
28-Feb-003

Report Date: 28-Feb-003

Formatted Report: TTITLE, BTITLE, and Date


SET LINESIZE 85
TTITLE LEFT "My Company" CENTER "CURRENT" -
RIGHT "Report Date: " report_date SKIP 1 -
CENTER "Employee Listing" SKIP 3
BTITLE LEFT " Report is developed by Cyrus Azarbod" -
RIGHT "Page" FORMAT 999 SQL.PNO
COLUMN lname HEADING "Last Name" JUSTIFY CENTER
COLUMN fname HEADING "First Name" JUSTIFY CENTER

SELECT employee_no, fname, lname, dob, commission, branch_no


FROM employee;

CLEAR COLUMN
TTITLE OFF

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.6
BTITLE OFF

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.7
My Company CURRENT Report Date: 28-Feb-003
Employee Listing

EMPLOYEE_NO First Name Last Name DOB COMMISSION BRANCH_NO


----------- -------------- -------------- --------- ---------- ---------
1001 JUSTIN GRIFFIN 01-JAN-78 50 7001
1002 KEITH DIAZ 02-FEB-61 50 7002
1003 SAMUEL HAYES 03-MAR-42 50 7003
1004 WILLIE MYERS 04-APR-83 100 7004
1005 RALPH FORD 05-MAY-64 80 7005
1006 MARY HAMILTON 06-JUN-75 50 7006
1007 PATRICIA GRAHAM 07-JUL-54 70 7007
1008 LINDA SULLIVAN 08-AUG-56 60 7008
1009 BARBARA JONES 09-SEP-68 50 7009
1010 ELIZABETH BROWN 10-OCT-81 100 7010
1011 JENNIFER DAVIS 11-NOV-72 100 7011
1012 MARIA MILLER 12-DEC-69 100 7012

Report is developed by Cyrus Azarbod Page 1

Report Header and Page Breaks


The REPHEADER command defines a report header. Report header print on the first page of
a report after the page title and before the first detail line.

Page Breaks
SET NEWPAGE controls SQL*Plus's action when a page break occurs.
By default, SQL*Plus prints one blank line between each page of output.
SET NEWPAGE 10

SQL*Plus can print one form-feed character between pages if it SETS to zero
SET NEWPAGE 0

Both form-feed character and blank line can be eliminated by setting it to NONE. This
option available in newer SQL*Plus version!
SET NEWPAGE NONE
Report Breaks
Break command can be Used to eliminate repetitive column values.
SQL*Plus prints the value of the column only when it changes.
It is important to sort the query results on the same column.

BREAK ON OWNER
SELECT owner, table_name
FROM all_tables
ORDER BY owner, table_name;

-- without BREAK command


SELECT owner, table_name
FROM all_tables
ORDER BY owner, table_name;

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.8
Without BREAK command
SELECT owner, table_name
FROM all_tables
ORDER BY owner, table_name;

OWNER TABLE_NAME
------------------------------ ----------------
MLS SPONSER
MLS TEAM
MLS TEAMPLAYER
MLS TEAMSPONSER
MLS TEAMSTATUS
MTSSYS MTS_PROXY_INFO
OES BRANCH
OES CUSTOMER
OES EMPLOYEE
OES ORDERLINE
OES ORDERS
OES PRODUCT
OES RETURNPROD
PROP BRANCH
....

With BREAK command


BREAK ON OWNER
SELECT owner, table_name
FROM all_tables
ORDER BY owner, table_name;

OWNER TABLE_NAME
------------------------------ ------------------
...
MLS ADDRESS
DRAFT
EMPLOYEE
EMPPOSITION
GAMESCHEDULE
GAMETYPE
OES BRANCH
CUSTOMER
EMPLOYEE
ORDERLINE
ORDERS
PRODUCT
RETURNPROD
PROP BRANCH
CLIENT
...

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.9
Break command to skip line(s) whenever a value changes
BREAK ON owner SKIP 1
SELECT owner, table_name
FROM all_tables
ORDER BY owner, table_name;

OWNER TABLE_NAME
------------------------------ ------------------
...
MLS ADDRESS
DRAFT
EMPLOYEE
EMPPOSITION
GAMESCHEDULE
GAMETYPE

OES BRANCH
CUSTOMER
EMPLOYEE
ORDERLINE
ORDERS
PRODUCT

RETURNPROD
PROP BRANCH
CLIENT
...

Break command to skip to a new page(s) whenever a value changes


BREAK ON owner SKIP PAGE
SELECT owner, table_name
FROM all_tables
ORDER BY owner, table_name;

OWNER TABLE_NAME
------------------------------ ------------------------------
...
MLS ADDRESS
DRAFT
EMPLOYEE

OWNER TABLE_NAME
------------------------------ ------------------------------
OES BRANCH
CUSTOMER
EMPLOYEE
ORDERLINE
ORDERS
PRODUCT
RETURNPROD

OWNER TABLE_NAME

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.10
------------------------------ ------------------------------
PROP BRANCH
CLIENT
LEASE
...

Multiple break for a report


BREAK ON TABLESPACE_NAME SKIP PAGE ON owner SKIP 1
SELECT TABLESPACE_NAME, owner, table_name
FROM all_tables
ORDER BY TABLESPACE_NAME, owner, table_name;

TABLESPACE_NAME OWNER TABLE_NAME


-------------------- --------------- ------------------------------
USERS DB2S1G18 VENDOR_PRODUCT

MLS ADDRESS
DRAFT
EMPLOYEE

PROP BRANCH
CLIENT
LEASE

TABLESPACE_NAME OWNER TABLE_NAME


-------------------- --------------- ------------------------------
USERS3 OES BRANCH
CUSTOMER
EMPLOYEE
ORDERLINE
ORDERS
PRODUCT
RETURNPROD
...

The COMPUTE command

∗This command computes summary values for a group of records.


∗COMPUTE is always used along with BREAKS

BREAK ON owner
COMPUTE COUNT OF table_name ON owner SKIP 1
col owner FORMAT A15
col table_name FORMAT A15
SELECT owner, table_name
FROM all_tables
ORDER BY owner, table_name;

CLEAR BREAK
CLEAR COMPUTE

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.11
The COMPUTE command- example

OWNER TABLE_NAME
--------------- ---------------
...
MLS SPONSER
TEAM
TEAMPLAYER
TEAMSPONSER
TEAMSTATUS
*************** ---------------
count 13
OES BRANCH
CUSTOMER
EMPLOYEE
ORDERLINE
ORDERS
PRODUCT
RETURNPROD
*************** ---------------
count 7
...

SQL*Plus FORMAT ELEMENTS


∗The COLUMN, ACCEPT, SET, NUMBER, TTITLE, BTITLE, REPHEADER, and REPFOOTER
command allow you to

∗control data format using what is called format specification. Format specification is string
of

∗characters that tell SQL*Plus exactly how to format a number, date, or text string when it
is displayed.

SQL*Plus FORMAT ELEMENTS:


Numeric Format Examples
Numeric Format Examples:

value Format Result


123 9999 123
1234.01 9,999.99 1,234.01
23456 $999,999.99 $23,456,00
1 0999 0001
1 99099 001
-1000.01 9,999.99mi 1,000.01-
1001 s9,999 +1,001
-1001 9,999PR <1,001>
1001 9,999PR 1,001

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.12
SQL*Plus FORMAT ELEMENTS:
Date Format Elements
Date Format Examples:

Format Result
dd-mon-yyyy 13-dec-2002
dd-Mon-yyyy 13-Dec-2002
DD-MON-YYYY 13-DEC-2002
Month DD, YYYY December 13, 2002
mm/dd/yyyy 12/13/2002
Day Friday

Column Format - Text


COLUMN a FORMAT A18
SELECT 'An apple a day keeps the doctor away.' a
FROM dual;

COLUMN a FORMAT A18 WORD_WRAPPED


SELECT 'An apple a day keeps the doctor away.' a
FROM dual;

A
------------------
An apple a day
keeps the doctor
away.

Column Format - Date


SELECT TO_CHAR(sysdate, 'dd-Mon-yyyy hh:mi:ss PM') as "New Date"
FROM dual;

New Date
-----------------------
05-Jan-2003 10:05:19 PM

SELECT TO_CHAR(sysdate, 'dd-Mon-yyyy') as "New Date"


FROM dual;

New Date
-----------
05-Jan-2003

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.13
Sample Report 1
Develop a report to list employee name, and commission.
This report should have date and page no. at bottom of each page.

CLEAR COLUMN
CLEAR BREAK
CLEAR COMPUTE
TTITLE OFF
BTITLE OFF

SET linesize 70
COLUMN name head 'Employee |Name' for a35
COLUMN commission head 'Total Commission' for $99,999.99
COLUMN sysdate noprint old_val day
TTITLE center "Employee First and Last Names"
BTITLE day center sql.pno

SELECT sysdate, lname||','|| fname name, commission


FROM branch b, employee e
WHERE b.branch_no = e.branch_no;

Page Width and Length

Employee First and Last Names


Employee
Name Total Commission
----------------------------------- ----------------
GRIFFIN ,JUSTIN $30000.00
DIAZ ,KEITH $50000.00
HAYES ,SAMUEL $50000.00
MYERS ,WILLIE $40000.00
FORD ,RALPH $45000.00
HAMILTON ,MARY $50000.00
GRAHAM ,PATRICIA $70000.00
SULLIVAN ,LINDA $60000.00
JONES ,BARBARA $50000.00
...
28-FEB-03 1

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.14
Sample Report 2
∗Develop a formatted report to list every branch and employee assigned to that branch
∗This list should include last name, and commission.
∗This report should have date and page number at bottom of every page.

CLEAR COLUMN
CLEAR BREAK
CLEAR COMPUTE
TTITLE OFF
BTITLE OFF
SET PAGESIZE 10
COLUMN city format a13
COLUMN city noprint new_val branch
COLUMN sysdate noprint old_val day
TTITLE LEFT "List of Employee for branch:" center branch
BTITLEe day CENTER sql.pno skip 1
BREAK ON city page
COLUMN 'First Name' format a14
COLUMN 'Last Name' format a14

SELECT sysdate, b.city, lname "Last Name", fname "First Name", commission
FROM branch b, employee e
where b.branch_no = e.branch_no;
SET PAGESIZE 24

Sample Report 2 - Results

List of employee for branch: Kansas City

Last Name First Name COMMISSION


-------------- -------------- ----------
GRIFFIN JUSTIN 50000

List of employee for branch: Chicago

Last Name First Name COMMISSION


-------------- -------------- ----------
DIAZ KEITH 50000

List of employee for branch: Rochester

Last Name First Name COMMISSION


-------------- -------------- ----------
MARTIN SANDRA 80000
GARCIA DONNA 80000

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.15
Sample Report 3

SET LINESIZE 200


CLEAR COLUMN
CLEAR BREAK
CLEAR COMPUTE
TTITLE OFF
BTITLE OFF
SET PAGESIZE 24

COLUMN city format a13


COLUMN commission for $99,999.99
COLUMN fname format a12
COLUMN lname format a12
COLUMN sysdate noprint old_val day
BREAK ON city SKIP 2
COMPUTE sum label 'Total Branch commission' of commission on city
TTITLE LEFT "List of Employee "
BTITLE day CENTER sql.pno skip 1
COLUMN 'First Name' format a14
COLUMN 'Last Name' format a14
SELECT sysdate, b.city, lname "Last Name", fname "First Name", commission
FROM branch b, employee e
WHERE b.branch_no = e.branch_no;
/

Sample Report 3

List of Employee

CITY Last Name First Name COMMISSION


------------- -------------- -------------- -----------
Total Branch $80.00
Rochester MARTIN SANDRA $80.00
GARCIA DONNA $80.00

************* -----------
Total Branch $160.00

28-FEB-03 9
...

25 rows selected.

ARRAY and AUTO[COMMIT]


ARRAY[SIZE] {n}
-- Sets the number of records Oracle will fetch at one time.
-- Default is 20. The range is between 1 and 5000
SET ARRAY 30

AUTO[COMMIT]

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.16
-- Determines whether Oracle will commit changes immediately or
-- after a specified number of commands
SET AUTOCOMMIT

AUTOT[RACE] and BLOCKTERMINATOR


AUTOT[RACE] {ON | OFF | EXP | STAT}
-- Allows you to see the execution path for a query after it has been executed
-- Acceptable values are ON, OFF, EXP[LAINE], and STAT[ISTICS]
SET AUTOTRACE

BLOCKTERMINATOR
-- Determines the symbol used to denote the end of a PL/SQL block

CLOSECURSOR and COLSEP


CLOSECURSOR {OFF | ON}
-- Determines whether a cursor will close and reopen after each SQL statement.
-- The default is ON
set CLOSECURSOR

COLSEP {TEXT| }
-- Determine the values to be printed between columns.

CONCAT and DEF[INE]


CONCAT
-- Changes the symbol used to concatenated string values.
-- The default is a pipe symbol '|'.
SET CONCAT 4

DEF[INE]
-- Defines the character is used to indicate a substitution variable.
-- The default is '&'.

ECHO, EDITF[ILE], and ESCAPE


ECHO {OFF | ON}
The ON setting causes the SQL commands to display.
The default is OFF

EDITF[ILE]
Sets the default filename that the EDIT command uses.

ESCAPE
The escape symbol may be changed from the default backslash '\'.
OFF disables this setting.

Feedback and HEADING


-- Displays the feedback ONLY if there is at least 11 or more records
SET FEEDBACK on
SET FEEDBACK 11
SELECT * FROM Employee;

HEA[DING] {OFF | ON}


-- The OFF setting will not display the column headings

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.17
-- The default is ON
SET HEADING OFF

HEADS[EP] - LIN[ESIZE]
HEADS[EP] {OFF | ON}
-- Changes the default heading separator '|' to another symbol.

LIN[ESIZE] {n}
-- Page width is controlled by LINESIZE.
-- Default line size is set to 80
SET LINESIZE 50

LONG - MARK[UP] HTML


LONG {80|n}
-- Sets the maximum width for displaying LONG values.
-- The value may be set to from 1 to 32,767.
SET LONG 1000

MARK[UP] HTML {OFF | ON}


-- Cause Oracle to output HTML.
-- The Heading text option allows you to specify a value for <HEAD> tag.
-- A BODY text option allows you to specify a value for <BODY> tag.
-- A SPOOL ON and OFF option determines whether SQL*Plus writes -
-- tags to the start and each file by the normal SPOOL command
SET MARKUP HTML ON

HEADS[EP] - LIN[ESIZE]
NEWP[AGE]
-- Specifies the number of blank lines to be printed between the bottom -
-- of one page and the top of the next page
-- A value of 0 sends a form feed at the top of each page

NULL
-- Enables you to substitute text for a null value when they are encountered

PAGESIZE
PAGESIZE {n}
∗Specifies the number of lines per page of output.
∗The default is set print 24 lines.
∗The printed lines includes the page header and footer lines.
∗Setting PAGESIZE to zero has special meaning in SQL*PLUS.
∗A PAGESIZE of zero will not print page header and footer, and col headings.
∗When using SET MARKUP HTML ON to generate HTML output, PAGESIZE controls -
∗the number of HTML table rows that display before column heading are repeated.
set PAGESIZE 12

_________________________________________________________________________
© Cyrus Azarbod Oracle SQL *Plus 2.5.18

Das könnte Ihnen auch gefallen