| UMBC CMSC 461 Spring '99 | CSEE | 461 | 461 S'99 | lectures | news | Oracle Help | help |
| NAME | DESCRIPTION |
|---|---|
| describe | Lists the column definitions for a database table |
| execute | Executes a single PL/SQL statement |
| help | Get online help for SQL*Plus commands |
| host | Executes a host operating system command |
| remark | Used for commands (also -- ) |
| run | Executes the SQL statement present in the buffer |
| set | Sets SQL*Plus system variables |
| spool | Stores the query results in an operating system file |
| start | Executes commands in an operating system file |
| COMMAND | DESCRIPTION |
|---|---|
| append text | Add text to the end of the line |
| change /old/new | Change old to new in a line |
| change /text | Delete text from a line |
| clear buffer | Deletes all lines |
| del | Delete a line |
| get file | Reads a file into the buffer |
| input | Add one or more lines |
| input text | Add a line of text |
| list | List all lines in a buffer |
| list n | List one line and make it current |
| list * | List the current line |
| list last | List the last line |
| list m n | List lines m through n |
| save file | Save contents of buffer to a file named file |
column student-no heading "Student ID" format 99999 column lastnaem heading "Last Name" format A15 column price format $9,99.99
| ELEMENT | EXAMPLE | DESCRIPTION |
|---|---|---|
| 9 | 9999 | Number of "9"s specifies digits returned. Blanks are returned for leading zeroes and a zero is displayed for a value of zero. |
| 0 | 0999 9990 | Displays a zero value as blank, or a value of zero in this position as a 0 |
| $ | $9999 | Prefixes value with dollar sign |
| B | B9999 | Displays a value as a blank, regardless of the "0"s in the format model |
| MI | 9999MI | Displays "-" after a negative values. For a positive value, a trailing space is displayed. |
| S | S9999 | Returns "+" or positive values and "-" for negative values in this position. |
| PR | 99D99 | Displays a negative value in <angle brackets>. For a positive value, a leading and trailing space is displayed. |
| D | 9G999 | Displays the decimal character in this position, separating the integral and fractional parts of a number. |
| G | 9G999 | Displays the group separator in this position. |
| C | C999 | Displays the ISO currency symbol in this position. |
| L | L999 | Displays the local currency symbol in this position. |
| ,(comma) | 9,999 | displays a comma in this position. |
| .(period) | 99.99 | Displays a period (decimal point) in this position, separating the integral and fractional parts of a number. |
| V | 999V99 | Multiiplies value by 10 |
| EEEE | 9.999EEEE | Displays value in scientific notation (format must contain exactly four "E"s. |
| RN or rn | RN | Displays upper- or lowercaseRoman numberals. Value can be an integer between 1 and 3999 |
| DATE | DATE | Displays value as a date in MM/DD/YY format; used to format NUMBER columns that represent Julian Dates. |
| FUNCTION | COMPUTES | APPLIES TO DATATYPES |
|---|---|---|
| AVG | Average of non-null values | NUMBER |
| COUNT | Count of non-null values | All types |
| MAX | Maximum value | NUMBER, CHAR, NCHAR, VARCHAR2, NVARCHAR2 (NCHAR VARYING) |
| MIN | Minimum | NUMBER, CHAR, NCHAR, VARCHAR2, NVARCHAR2 (NCHAR VARYING) |
| NUMBER | Count of rows | All types |
| STD | Standard deviation of non-null values | NUMBER |
| SUM | Sum of all non-null values | NUMBER |
| D | Variance of non-null values | NUMBER |
spool report.dat
clear columns
clear breaks
clear computes
set headsep !
ttitle 'Student Report!Fall 1998!CMSC-461'
btitle 'Report by Gary Burt'
column studentno heading 'Student ID' format a10 word-wrapped
column lastname heading 'Last Name' format a12 word-wrapped
column firstname heading 'First Name' format a12 word-wrapped
column componentname heading 'Component' format a10 word-wrapped
column points heading 'Points' format 9990
break on studentno
compute sum of points on studentno
set linesize 79
set pagesize 50
set newpage 0
select E.studentno, S.lastname, S.firstname, T.points
from enrolls E, students S, components C, scores T
where S.studentno = T.studentno and
S.studentno = E.studentno and
E.term = C.term and
E.stars = C.stars and
C.componentname = T.componentname and
E.term = 'Fall 98' and
E.stars = 7231;
spool off
Spool capture.dat Set echo on
set echo off spool off