What is the method for formatting the results of a SQLPlus query?
In SQL*Plus, the following commands can be used to format query results:
- Format columns:
COLUMN column_name FORMAT format
For example, format the column named “employee_name” to a width of 50 characters.
COLUMN employee_name FORMAT A50
- Set the footer format.
SET PAGESIZE n
n is the number of lines displayed per page.
- Set the header format:
SET HEADSEP off
Disable the header separator line.
- Title setting:
SET TITLE title
For example, setting the title as “Employee Information”
SET TITLE 'Employee Information'
- Set column delimiter:
SET COLSEP separator
For example, set the column delimiter to a comma.
SET COLSEP ,
- View current formatting:
SHOW ALL
The above commands allow for flexible formatting of query results to meet different needs.