Chapter 14 Formatting Readable Output. Chapter Objectives Add a column heading with a line break to...

21
Chapter 14 Formatting Readable Output

Transcript of Chapter 14 Formatting Readable Output. Chapter Objectives Add a column heading with a line break to...

Page 1: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

Chapter 14Formatting Readable

Output

Chapter 14Formatting Readable

Output

Page 2: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

Basic Report Creation in SQL*PlusBasic Report Creation in SQL*Plus

Enter format for the report Enter a query to retrieve data

Enter format for the report Enter a query to retrieve data

Page 3: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

COLUMN CommandCOLUMN Command

Formats both column heading and data displayed in columnFormats both column heading and data displayed in column

Page 4: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

COLUMN Command OptionsCOLUMN Command Options

Page 5: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

FORMAT OptionFORMAT Option

Specifies format model for the data Specifies format model for the data

Page 6: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

FORMAT ExampleFORMAT Example

Page 7: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

HEADING OptionHEADING Option

Specifies a column heading Specifies a column heading

Page 8: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

Output with HEADING OptionOutput with HEADING Option

Page 9: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

SET CommandSET Command

SET command used to change the UNDERLINE variable

Assign blank space to add separator with FORMAT option of COLUMN command

SET command used to change the UNDERLINE variable

Assign blank space to add separator with FORMAT option of COLUMN command

Page 10: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

Modified ReportModified Report

Page 11: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

NULL OptionNULL Option

Provides substitute for NULL valuesProvides substitute for NULL values

Page 12: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

Report Headers and FootersReport Headers and Footers

Header– Appears at top of reports– Created with TTITLE command

Footer– Appears at bottom of reports– Created with BTITLE command

Header– Appears at top of reports– Created with TTITLE command

Footer– Appears at bottom of reports– Created with BTITLE command

Page 13: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

TTITLE and BTITLE OptionsTTITLE and BTITLE Options

Page 14: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

SQL*Plus VariablesSQL*Plus Variables

Page 15: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

BREAK CommandBREAK Command

Suppresses duplicate data Allows blank lines after groups

Suppresses duplicate data Allows blank lines after groups

Page 16: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

BREAK Command ExampleBREAK Command Example

Page 17: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

CLEAR CommandCLEAR Command

Used to clear settings applied to the BREAK and COLUMN commandsUsed to clear settings applied to the BREAK and COLUMN commands

Page 18: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

COMPUTE CommandCOMPUTE Command

Can include AVG, SUM, COUNT, MAX, or MIN keywordsCan include AVG, SUM, COUNT, MAX, or MIN keywords

Page 19: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

COMPUTE Command ExampleCOMPUTE Command Example

Page 20: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

SPOOL CommandSPOOL Command

Saves results to text fileSaves results to text file

Page 21: Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.

SPOOL Command ExampleSPOOL Command Example