RelationalDBDesign RelationalDBDesign


SQL Extensions   «Prev  Next»

SQL*Plus Commands to adjust Column and Page Settings

Course project: Using SQL*Plus commands to adjust column and page settings

Your solution should have followed these steps:
  1. You executed the query for your report by typing / at the SQL> prompt and pressing Enter.
  2. You created a file with this query in it so that you could add some SQL*Plus commands to it. You wrote the query to a file named CUST_BUY.sql by typing SAVE CUST_BUY at the SQL> prompt and pressing Enter.
  3. You made some changes to the file you created by starting up a text editor. You typed EDIT CUST_BUY at the SQL> prompt and pressed Enter.
  4. In the first line of the file, you typed COLUMN SALES_DATE HEADING "SALES DT" to change the heading of the first column in the Select clause to SALES DT. You then pressed Enter.
  5. You changed the column width to 15 characters and changed the column heading to NAME by typing COLUMN LASTNAME FORMAT A15 HEADING "NAME" in the next line. You then pressed Enter.
  6. You changed the column width to two numeric characters and changed the column heading to # ITEMS by typing COLUMN PROD_COUNT FORMAT 99 HEADING "# ITEMS" in the next line. You then pressed Enter.
  7. You typed COLUMN TOTAL_SALE FORMAT 9999.99 HEADING "PMT" at the first blank line in the file to change the column width to four numbers to the left and two numbers to the right of the decimal point, and to change the column heading to PMT. You then pressed Enter.
  8. You changed the number of lines per page to 22 by typing SET PAGESIZE 22 at the first blank line in the file and then pressing Enter.
  9. You changed the number of characters per line to 45 by typing SET LINESIZE 45 in the next blank line and then clicking the X in top right corner to close the text editor.
  10. You saved your changes by clicking the Yes button. /li>
  11. You tested your query and the SQL*Plus environment settings you made by typing START CUST_BUY at the SQL> prompt and pressing Enter.
  12. You viewed the query results and then completed the exercise by clicking the Exit button.