home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-04 | 399.0 KB | 15,102 lines |
- load data
- infile *
- concatenate 2
- into table help replace
- fields
- (
- seq char (3) terminated by ',',
- topic char (30) terminated by ',',
- info position (*) char (80)
- )
- BEGINDATA
- 1,/,
-
- 2,/,
-
- 3,/,
- / (slash)
- 4,/,
-
- 5,/,
- /
- 6,/,
-
- 7,/,
- Enter a slash (/) at the command prompt or at a line number prompt to
- 8,/,
- execute a SQL command or PL/SQL block in the SQL buffer. The slash
- 9,/,
- command works like RUN, but does not list the command on your screen
- 10,/,
- buffer.
- 11,/,
-
- 12,/,
- Executing a SQL command or PL/SQL block with the slash does not change the
- 13,/,
- current line number in the SQL buffer unless the command in the buffer has
- 14,/,
- an error. If so, SQL*Plus makes the line with the error the current line.
- 15,/,
-
- 16,/,
- Examples: Type LIST to see the contents of the buffer:
- 17,/,
-
- 18,/,
- SQL> LIST
- 19,/,
- 1* SELECT ENAME, JOB FROM EMP WHERE ENAME = 'JAMES'
- 20,/,
-
- 21,/,
- Enter / (slash) to execute the command in the buffer:
- 22,/,
-
- 23,/,
- SQL> / Output: ENAME JOB
- 24,/,
- ------ -----
- 25,/,
- JAMES CLERK
- 26,/,
-
- 27,/,
- See also: @, edit, get, list, run, save, parameters, set (SQL buffer),
- 28,/,
- spool, start, commands, menu.
- 1,1 Row Char Functions,
-
- 2,1 Row Char Functions,
-
- 3,1 Row Char Functions,
- 1 Row Char Functions
- 4,1 Row Char Functions,
-
- 5,1 Row Char Functions,
- ASCII(string) Returns collating sequence value of 1st char of string.
- 6,1 Row Char Functions,
- CHR(n) Returns character having ASCII or EBCDIC value of n.
- 7,1 Row Char Functions,
- INITCAP(char) Capitalizes each word's first letter, others lowercase.
- 8,1 Row Char Functions,
- INSTR(char1, Beginning at position m, returns the position of the
- 9,1 Row Char Functions,
- char2, m, n) nth occurrence of char2 in char1; m & n = 0 if absent.
- 10,1 Row Char Functions,
- LENGTH(char) Returns the length of char.
- 11,1 Row Char Functions,
- LOWER(char) Returns char in lowercase.
- 12,1 Row Char Functions,
- LPAD(char1, Adds char2 n number of times in front of char1.
- 13,1 Row Char Functions,
- n, char2)
- 14,1 Row Char Functions,
- LTRIM(char, s) Removes beginning characters from char, up to the first
- 15,1 Row Char Functions,
- character not in the s set; s = ''if absent.
- 16,1 Row Char Functions,
- NLSSORT(char) Gives char's National Language collating sequence.
- 17,1 Row Char Functions,
- REPLACE(char, Changes each find in char to new; omit new to erase
- 18,1 Row Char Functions,
- find, new) find. Use TRANSLATE for single characters.
- 19,1 Row Char Functions,
- RPAD(char1, n, Adds char2 n number of times after char1.
- 20,1 Row Char Functions,
- char2)
- 21,1 Row Char Functions,
- RTRIM(char, set) Removes characters from the end of char until the
- 22,1 Row Char Functions,
- first character not in set; set = ''if absent.
- 23,1 Row Char Functions,
- SOUNDEX(char) Returns string phonetically equivalent to char.
- 24,1 Row Char Functions,
- SUBSTR(char, Returns n characters in char, starting at char c.
- 25,1 Row Char Functions,
- c, n)
- 26,1 Row Char Functions,
- TRANSLATE(char, Returns char with each find changed to new.
- 27,1 Row Char Functions,
- find, new)
- 28,1 Row Char Functions,
- UPPER(char) Returns char in UPPERCASE.
- 29,1 Row Char Functions,
-
- 30,1 Row Char Functions,
-
- 31,1 Row Char Functions,
- See also: 1 row number, conversion, date functions, error reporting,
- 32,1 Row Char Functions,
- group, other functions, commands, menu.
- 1,1 Row Number Functions,
-
- 2,1 Row Number Functions,
-
- 3,1 Row Number Functions,
- 1 Row Number Functions
- 4,1 Row Number Functions,
-
- 5,1 Row Number Functions,
- ABS(n) Returns the absolute value of n.
- 6,1 Row Number Functions,
-
- 7,1 Row Number Functions,
- CEIL(n) Returns the smallest integer greater than or equal to n.
- 8,1 Row Number Functions,
-
- 9,1 Row Number Functions,
- FLOOR(n) Returns the largest integer less than or equal to n.
- 10,1 Row Number Functions,
-
- 11,1 Row Number Functions,
- MOD(m,n) Returns result of m divided by n; or if n=0, m returned.
- 12,1 Row Number Functions,
-
- 13,1 Row Number Functions,
- POWER(m,n) Returns m raised to the nth power; n must be an integer.
- 14,1 Row Number Functions,
-
- 15,1 Row Number Functions,
- ROUND(m,n) Returns m rounded to n (optional) decimal places.
- 16,1 Row Number Functions,
-
- 17,1 Row Number Functions,
- SIGN(n) Returns -1 if n is negative, 1 if n is positive, 0 if n=0.
- 18,1 Row Number Functions,
-
- 19,1 Row Number Functions,
- SQRT(n) Returns the square root of n.
- 20,1 Row Number Functions,
-
- 21,1 Row Number Functions,
- TRUNC(m,n) Strips m to n (opt) places; -n adds n zeros to an integer.
- 22,1 Row Number Functions,
-
- 23,1 Row Number Functions,
-
- 24,1 Row Number Functions,
- See also: 1 row char, conversion, date functions, error reporting,
- 25,1 Row Number Functions,
- group, other functions, commands, menu.
- 1,@,
- @
- 2,@,
- @ ("at" sign)
- 3,@,
-
- 4,@,
- @ file_name[.ext ]
- 5,@,
-
- 6,@,
- Runs the specified command file.
- 7,@,
-
- 8,@,
- file_name[.ext ]
- 9,@,
- is the command file you wish to run. If you omit ext, SQL*Plus
- 10,@,
- assumes the default command-file extension (usually SQL). To
- 11,@,
- change the default extension, use the SUFFIX clause of the SET
- 12,@,
- command. Use @file_name or @ file_name; the space is optional.
- 13,@,
- Case may be significant in some operating environments.
- 14,@,
-
- 15,@,
- You can include in a command file any typeable command--usually SQL or
- 16,@,
- SQL*Plus commands. The @ command works like START, but does not allow
- 17,@,
- values to be passed to parameters.
- 18,@,
-
- 19,@,
- Examples:
- 20,@,
-
- 21,@,
- To run a command file named PRINTRPT.SQL, enter:
- 22,@,
-
- 23,@,
- SQL> @PRINTRPT
- 24,@,
-
- 25,@,
-
- 26,@,
- To run the command file WKRPT with the extension QRY, enter:
- 27,@,
-
- 28,@,
- SQL> @WKRPT.QRY
- 29,@,
-
- 30,@,
-
- 31,@,
- See also: suffix, start, /, edit, run, get, set (SQL buffer), spool,
- 32,@,
- list, save, parameters, commands, menu.
- 1,ACCEPT,
-
- 2,ACCEPT,
-
- 3,ACCEPT,
- ACCEPT
- 4,ACCEPT,
-
- 5,ACCEPT,
- ACC[EPT] variable [NUM[BER]|CHAR] [PROMPT text|NOPR[OMPT]] [HIDE]
- 6,ACCEPT,
-
- 7,ACCEPT,
- ACCEPT reads a line of input and stores it in a given user variable.
- 8,ACCEPT,
-
- 9,ACCEPT,
- variable
- 10,ACCEPT,
- is the name of the variable in which you wish to store a value.
- 11,ACCEPT,
- If variable doesn't exist, SQL*Plus creates it.
- 12,ACCEPT,
-
- 13,ACCEPT,
- NUM[BER]
- 14,ACCEPT,
- restricts the datatype of variable to the datatype NUMBER. If the
- 15,ACCEPT,
- reply does not match the datatype, ACCEPT gives an error message
- 16,ACCEPT,
- and terminates.
- 17,ACCEPT,
-
- 18,ACCEPT,
- CHAR
- 19,ACCEPT,
- restricts the datatype of variable to the datatype CHAR. If the
- 20,ACCEPT,
- reply does not match the datatype, ACCEPT gives an error message
- 21,ACCEPT,
- and terminates.
- 22,ACCEPT,
-
- 23,ACCEPT,
- PROMPT text
- 24,ACCEPT,
- displays text on-screen before accepting the value of variable
- 25,ACCEPT,
- from the user.
- 26,ACCEPT,
-
- 27,ACCEPT,
- NOPR[OMPT]
- 28,ACCEPT,
- skips a line and waits for input; prompt not displayed.
- 29,ACCEPT,
-
- 30,ACCEPT,
- HIDE
- 31,ACCEPT,
- suppresses the display as you type the reply.
- 32,ACCEPT,
-
- 33,ACCEPT,
-
- 34,ACCEPT,
- Examples: To display the prompt text "Salary: " and place the reply in a
- 35,ACCEPT,
- NUMBER variable named SALARY, enter:
- 36,ACCEPT,
-
- 37,ACCEPT,
- SQL> ACCEPT salary NUMBER PROMPT 'Salary: '
- 38,ACCEPT,
-
- 39,ACCEPT,
-
- 40,ACCEPT,
- To display the prompt "Password: ", and place the reply in the
- 41,ACCEPT,
- CHAR variable PSWD, while suppressing the display, enter:
- 42,ACCEPT,
-
- 43,ACCEPT,
- SQL> ACCEPT pswd CHAR PROMPT 'Password: ' HIDE
- 44,ACCEPT,
-
- 45,ACCEPT,
-
- 46,ACCEPT,
- See also: define, input, prompt, parameters, commands, menu.
- 1,ALTER CLUSTER,
-
- 2,ALTER CLUSTER,
-
- 3,ALTER CLUSTER,
- ALTER CLUSTER
- 4,ALTER CLUSTER,
- SQL statement
- 5,ALTER CLUSTER,
-
- 6,ALTER CLUSTER,
- ALTER CLUSTER user.cluster --user. and clauses below optional
- 7,ALTER CLUSTER,
- PCTUSED integer --min space use per block; default is 40
- 8,ALTER CLUSTER,
- PCTFREE integer --% of block for updates; default is 10
- 9,ALTER CLUSTER,
- SIZE integer --the number of cluster keys stored
- 10,ALTER CLUSTER,
- INITRANS integer --initial number of transactions entries
- 11,ALTER CLUSTER,
- MAXTRANS integer --maximum number of transactions at once
- 12,ALTER CLUSTER,
- STORAGE clause --controls space allocation
- 13,ALTER CLUSTER,
-
- 14,ALTER CLUSTER,
-
- 15,ALTER CLUSTER,
- ALTER CLUSTER redefines a cluster's future storage allocations. You can
- 16,ALTER CLUSTER,
- change any of the parameters listed, but you cannot:
- 17,ALTER CLUSTER,
-
- 18,ALTER CLUSTER,
- - change the number or name of columns in a cluster key
- 19,ALTER CLUSTER,
- - alter the MINEXTENTS parameter
- 20,ALTER CLUSTER,
- - alter any parameters affecting blocks already allocated
- 21,ALTER CLUSTER,
- - remove tables from a cluster (use DROP CLUSTER and DROP TABLE)
- 22,ALTER CLUSTER,
- - alter a cluster's tablespace
- 23,ALTER CLUSTER,
-
- 24,ALTER CLUSTER,
- See also: create cluster, create table, commands, menu.
- 1,ALTER DATABASE,
-
- 2,ALTER DATABASE,
-
- 3,ALTER DATABASE,
- ALTER DATABASE
- 4,ALTER DATABASE,
- SQL statement
- 5,ALTER DATABASE,
- ALTER DATABASE database
- 6,ALTER DATABASE,
- ADD LOGFILE 'filename' SIZE integer K | M REUSE,...
- 7,ALTER DATABASE,
- DROP LOGFILE 'filename', 'filename',...
- 8,ALTER DATABASE,
- RENAME FILE 'filename', 'filename',...
- 9,ALTER DATABASE,
- TO 'filename', 'filename',...
- 10,ALTER DATABASE,
- ARCHIVELOG | NOARCHIVELOG
- 11,ALTER DATABASE,
- MOUNT SHARED | EXCLUSIVE
- 12,ALTER DATABASE,
- DISMOUNT
- 13,ALTER DATABASE,
- OPEN | CLOSE NORMAL | IMMEDIATE
- 14,ALTER DATABASE,
-
- 15,ALTER DATABASE,
- Use the ALTER DATABASE statement to mount a database, either shared
- 16,ALTER DATABASE,
- or exclusive; open or close a database; add, drop, or rename a redo
- 17,ALTER DATABASE,
- log file; or rename a database file. You can also set the redo log
- 18,ALTER DATABASE,
- to be archived (useful for media recovery), or not archived (useful
- 19,ALTER DATABASE,
- only for instance recovery). If database is omitted, the value for
- 20,ALTER DATABASE,
- DB_NAME in the current INIT.ORA file is assumed.
- 21,ALTER DATABASE,
-
- 22,ALTER DATABASE,
-
- 23,ALTER DATABASE,
- See also: create database, commands, menu.
- 1,ALTER INDEX,
-
- 2,ALTER INDEX,
-
- 3,ALTER INDEX,
- ALTER INDEX
- 4,ALTER INDEX,
- SQL statement
- 5,ALTER INDEX,
- ALTER INDEX user.index
- 6,ALTER INDEX,
- INITRANS integer
- 7,ALTER INDEX,
- MAXTRANS integer
- 8,ALTER INDEX,
- STORAGE clause
- 9,ALTER INDEX,
-
- 10,ALTER INDEX,
- Use the ALTER INDEX statement to change future storage allocations for
- 11,ALTER INDEX,
- index blocks. INITRANS, MAXTRANS, and STORAGE work the same way they
- 12,ALTER INDEX,
- do in the CREATE TABLE statement.
- 13,ALTER INDEX,
-
- 14,ALTER INDEX,
-
- 15,ALTER INDEX,
- See also: create index, create table, commands, menu.
- 1,ALTER ROLLBACK SEGMENT,
-
- 2,ALTER ROLLBACK SEGMENT,
-
- 3,ALTER ROLLBACK SEGMENT,
- ALTER ROLLBACK SEGMENT
- 4,ALTER ROLLBACK SEGMENT,
- SQL statement
- 5,ALTER ROLLBACK SEGMENT,
- ALTER PUBLIC ROLLBACK SEGMENT segment
- 6,ALTER ROLLBACK SEGMENT,
- STORAGE clause
- 7,ALTER ROLLBACK SEGMENT,
-
- 8,ALTER ROLLBACK SEGMENT,
-
- 9,ALTER ROLLBACK SEGMENT,
- Use ALTER ROLLBACK SEGMENT to make a rollback segment public or alter its
- 10,ALTER ROLLBACK SEGMENT,
- storage parameters. Use PUBLIC to make a rollback segment available for
- 11,ALTER ROLLBACK SEGMENT,
- use in any instance. To make a public rollback segment private, you must
- 12,ALTER ROLLBACK SEGMENT,
- DROP it, then CREATE it again.
- 13,ALTER ROLLBACK SEGMENT,
-
- 14,ALTER ROLLBACK SEGMENT,
- The STORAGE clause affects future space allocation in a rollback segment.
- 15,ALTER ROLLBACK SEGMENT,
- You can't use INITIAL or MINEXTENTS to alter an existing rollback segment.
- 16,ALTER ROLLBACK SEGMENT,
-
- 17,ALTER ROLLBACK SEGMENT,
-
- 18,ALTER ROLLBACK SEGMENT,
- See also: create database, create rollback, create tablespace, rollback,
- 19,ALTER ROLLBACK SEGMENT,
- commands, menu.
- 1,ALTER SEQUENCE,
-
- 2,ALTER SEQUENCE,
-
- 3,ALTER SEQUENCE,
- ALTER SEQUENCE
- 4,ALTER SEQUENCE,
- SQL statement
- 5,ALTER SEQUENCE,
- ALTER SEQUENCE user.sequence
- 6,ALTER SEQUENCE,
- INCREMENT BY integer
- 7,ALTER SEQUENCE,
- MAXVALUE integer | NOMAXVALUE
- 8,ALTER SEQUENCE,
- MINVALUE integer | NOMINVALUE
- 9,ALTER SEQUENCE,
- CYCLE | NOCYCLE
- 10,ALTER SEQUENCE,
- CACHE integer | NOCACHE
- 11,ALTER SEQUENCE,
- ORDER | NOORDER
- 12,ALTER SEQUENCE,
-
- 13,ALTER SEQUENCE,
- Use ALTER SEQUENCE to change the future increment of sequence numbers,
- 14,ALTER SEQUENCE,
- to reset or remove its MINVALUE or MAXVALUE, or to turn CACHE and ORDER
- 15,ALTER SEQUENCE,
- on or off. The CACHE integer must be smaller than the difference between
- 16,ALTER SEQUENCE,
- MAXVALUE and MINVALUE. If you use CYCLE, an ascending sequence gives its
- 17,ALTER SEQUENCE,
- MINVALUE after reaching MAXVALUE, and a descending sequence gives its
- 18,ALTER SEQUENCE,
- MAXVALUE after reaching MINVALUE.
- 19,ALTER SEQUENCE,
-
- 20,ALTER SEQUENCE,
- To restart a sequence at a new number, DROP and CREATE it again.
- 21,ALTER SEQUENCE,
-
- 22,ALTER SEQUENCE,
-
- 23,ALTER SEQUENCE,
- See also: sequences, create sequence, drop sequence, commands, menu.
- 1,ALTER TABLE,
-
- 2,ALTER TABLE,
-
- 3,ALTER TABLE,
- ALTER TABLE
- 4,ALTER TABLE,
- SQL statement
- 5,ALTER TABLE,
- ALTER TABLE user.table
- 6,ALTER TABLE,
- ADD column_element | table_constraint,
- 7,ALTER TABLE,
- column_element | table_constraint,...
- 8,ALTER TABLE,
- MODIFY column_element, column_element,...
- 9,ALTER TABLE,
- DROP CONSTRAINT constraint, constraint,...
- 10,ALTER TABLE,
- PCTFREE integer PCTUSED integer
- 11,ALTER TABLE,
- INITRANS integer MAXTRANS integer
- 12,ALTER TABLE,
- STORAGE clause
- 13,ALTER TABLE,
- BACKUP
- 14,ALTER TABLE,
-
- 15,ALTER TABLE,
- Use ALTER TABLE to add columns or constraints to a table, change column
- 16,ALTER TABLE,
- datatypes, sizes, and NOT NULL settings, drop constraints, change future
- 17,ALTER TABLE,
- storage allocations, and update the data dictionary to show that a BACKUP
- 18,ALTER TABLE,
- of the table occurred when the statement was executed.
- 19,ALTER TABLE,
-
- 20,ALTER TABLE,
-
- 21,ALTER TABLE,
- See also: tables, create table, constraint, commands, menu.
- 1,ALTER TABLESPACE,
-
- 2,ALTER TABLESPACE,
-
- 3,ALTER TABLESPACE,
- ALTER TABLESPACE
- 4,ALTER TABLESPACE,
- SQL statement
- 5,ALTER TABLESPACE,
- ALTER TABLESPACE tablespace
- 6,ALTER TABLESPACE,
- ADD DATAFILE 'filename' SIZE integer K | M REUSE,...
- 7,ALTER TABLESPACE,
- RENAME DATAFILE 'filename', 'filename',...
- 8,ALTER TABLESPACE,
- TO 'filename', 'filename',...
- 9,ALTER TABLESPACE,
- DEFAULT STORAGE clause
- 10,ALTER TABLESPACE,
- ONLINE | OFFLINE NORMAL | IMMEDIATE
- 11,ALTER TABLESPACE,
- BEGIN BACKUP | END BACKUP
- 12,ALTER TABLESPACE,
-
- 13,ALTER TABLESPACE,
- Use ALTER TABLESPACE to add or rename database files, change default
- 14,ALTER TABLESPACE,
- tablespace storage parameters, put the tablespace online or offline,
- 15,ALTER TABLESPACE,
- and start or stop backup. To rename one or more data files:
- 16,ALTER TABLESPACE,
-
- 17,ALTER TABLESPACE,
- 1. Take the tablespace offline.
- 18,ALTER TABLESPACE,
- 2. Rename the files at the operating system level.
- 19,ALTER TABLESPACE,
- 3. Rename the database files with with ALTER TABLESPACE.
- 20,ALTER TABLESPACE,
- 4. Bring the tablespace back online.
- 21,ALTER TABLESPACE,
-
- 22,ALTER TABLESPACE,
-
- 23,ALTER TABLESPACE,
- See also: create tablespace, create database, drop tablespace, dba,
- 24,ALTER TABLESPACE,
- commands, menu.
- 1,ALTER USER,
-
- 2,ALTER USER,
-
- 3,ALTER USER,
- ALTER USER
- 4,ALTER USER,
- SQL statement
- 5,ALTER USER,
- ALTER USER username IDENTIFIED BY password
- 6,ALTER USER,
- DEFAULT TABLESPACE tablespace
- 7,ALTER USER,
- TEMPORARY TABLESPACE tablespace
- 8,ALTER USER,
-
- 9,ALTER USER,
- Use ALTER USER to change a user's password, the default tablespace for
- 10,ALTER USER,
- object creation, or the default temporary tablespace for temporary
- 11,ALTER USER,
- segments created for the user.
- 12,ALTER USER,
-
- 13,ALTER USER,
- A password may also be changed with the GRANT statement. A user's default
- 14,ALTER USER,
- tablespace is also set when that user is granted resource to a tablespace,
- 15,ALTER USER,
- if it's the first tablespace to which the user has been granted resource.
- 16,ALTER USER,
- The default temporary tablespace is also set to the first tablespace
- 17,ALTER USER,
- granted to a user.
- 18,ALTER USER,
-
- 19,ALTER USER,
-
- 20,ALTER USER,
- See also: user id, create tablespace, grant, commands, menu.
- 1,APPEND,
-
- 2,APPEND,
-
- 3,APPEND,
- APPEND
- 4,APPEND,
-
- 5,APPEND,
- A[PPEND] text
- 6,APPEND,
-
- 7,APPEND,
- Use APPEND to add text to the end of the current line in the buffer.
- 8,APPEND,
-
- 9,APPEND,
- text
- 10,APPEND,
- is the text you wish to append. To separate text from preceding
- 11,APPEND,
- characters with a space, enter two spaces between APPEND and the
- 12,APPEND,
- text. To APPEND text that ends with a semicolon, end the APPEND
- 13,APPEND,
- command with two semicolons (SQL*Plus interprets one semicolon as
- 14,APPEND,
- an optional command terminator).
- 15,APPEND,
-
- 16,APPEND,
-
- 17,APPEND,
- Examples: To append a space and the column name DEPT to the second line
- 18,APPEND,
- of the buffer, make that line the current line by entering:
- 19,APPEND,
-
- 20,APPEND,
- SQL> 2
- 21,APPEND,
- 2* FROM EMP
- 22,APPEND,
-
- 23,APPEND,
- Now enter APPEND:
- 24,APPEND,
-
- 25,APPEND,
- SQL> APPEND , DEPT
- 26,APPEND,
- SQL> 2
- 27,APPEND,
- 2* FROM EMP, DEPT
- 28,APPEND,
-
- 29,APPEND,
- The first space between APPEND and the comma separates APPEND
- 30,APPEND,
- from the characters to be appended; the second space is the
- 31,APPEND,
- first appended character. To append a semicolon to the line,
- 32,APPEND,
- enter:
- 33,APPEND,
-
- 34,APPEND,
- SQL> APPEND ;;
- 35,APPEND,
-
- 36,APPEND,
- SQL*Plus appends the first semicolon to the line. The second
- 37,APPEND,
- semicolon terminates the command.
- 38,APPEND,
-
- 39,APPEND,
-
- 40,APPEND,
- See also: change, del, edit, input, list, save, set (SQL buffer), spool,
- 41,APPEND,
- commands, menu.
- 1,AUDIT,
-
- 2,AUDIT,
-
- 3,AUDIT,
- AUDIT
- 4,AUDIT,
- SQL statement
- 5,AUDIT,
- There are two ways to use AUDIT: one sets auditing options for database
- 6,AUDIT,
- access, the other enables auditing of access to ORACLE objects (like
- 7,AUDIT,
- tables and views).
- 8,AUDIT,
-
- 9,AUDIT,
- *First Method*
- 10,AUDIT,
-
- 11,AUDIT,
- AUDIT system_option, system_option,... | ALL
- 12,AUDIT,
- WHENEVER SUCCESSFUL
- 13,AUDIT,
- WHENEVER NOT SUCCESSFUL
- 14,AUDIT,
-
- 15,AUDIT,
- The first method of AUDIT sets auditing options for database access. This
- 16,AUDIT,
- AUDIT form tracks:
- 17,AUDIT,
-
- 18,AUDIT,
- - connection to or disconnection from the database
- 19,AUDIT,
- - statements requiring RESOURCE privilege (RESOURCE system option)
- 20,AUDIT,
- - statements requiring DBA privileges (DBA system option)
- 21,AUDIT,
- - statements returning error ORA-942 "table or view does not exist"
- 22,AUDIT,
- (NOT EXISTS system option)
- 23,AUDIT,
-
- 24,AUDIT,
- Auditing is enabled system-wide via the AUDIT_TRAIL parameter of INIT.ORA.
- 25,AUDIT,
- If auditing is not enabled, AUDIT SQL statements execute successfully, but
- 26,AUDIT,
- no audit trail rows are written. All audit results go to data dictionary
- 27,AUDIT,
- tables. As audit data dictionary tables grow, you may archive old audit
- 28,AUDIT,
- records, then delete them. Never drop the audit data dictionary tables.
- 29,AUDIT,
-
- 30,AUDIT,
- *Second Method*
- 31,AUDIT,
-
- 32,AUDIT,
- AUDIT table_option, table_option,... | ALL
- 33,AUDIT,
- ON user.table | DEFAULT
- 34,AUDIT,
- BY SESSION | BY ACCESS
- 35,AUDIT,
- WHENEVER SUCCESSFUL | WHENEVER NOT SUCCESSFUL
- 36,AUDIT,
-
- 37,AUDIT,
- The second method of AUDIT enables auditing of access to ORACLE objects
- 38,AUDIT,
- like tables and views.
- 39,AUDIT,
-
- 40,AUDIT,
- BY SESSION or BY ACCESS
- 41,AUDIT,
- specifies how rows are written to table AUDIT_TRAIL. BY SESSION
- 42,AUDIT,
- records the type of access made to an object by updating a single
- 43,AUDIT,
- row for that session in AUDIT_TRAIL. BY ACCESS records the type
- 44,AUDIT,
- of access made and how often it was made by inserting a new row
- 45,AUDIT,
- in AUDIT_TRAIL for each access. The default is BY SESSION.
- 46,AUDIT,
-
- 47,AUDIT,
- WHENEVER SUCCESSFUL or WHENEVER NOT SUCCESSFUL
- 48,AUDIT,
- sets SQL statements to be audited only when they are successfully
- 49,AUDIT,
- completed, or only when they are not successfully completed.
- 50,AUDIT,
-
- 51,AUDIT,
- See also: noaudit, commands, menu.
- 1,Alias,
-
- 2,Alias,
-
- 3,Alias,
- Alias
- 4,Alias,
-
- 5,Alias,
- An alias is an alternative name for a column or table, active only
- 6,Alias,
- within the statement in which the alias is assigned. When an alias
- 7,Alias,
- name follows the name of a column in a SELECT list, the alias name
- 8,Alias,
- appears above the column in the report:
- 9,Alias,
- NAME NUM SALARY
- 10,Alias,
- SELECT ename NAME, empno NUM, sal SALARY --------------------
- 11,Alias,
- FROM emp ADAMS 7876 1100
- 12,Alias,
- WHERE job = 'ANALYST' JAMES 7900 950
- 13,Alias,
- ORDER BY NAME; MILLER 7934 800
- 14,Alias,
-
- 15,Alias,
- Use a table alias to join a table to itself in a correlated query:
- 16,Alias,
-
- 17,Alias,
- SELECT wkr.ename, wkr.sal, sup.ename, sup.sal
- 18,Alias,
- FROM emp wkr, emp sup ENAME SAL ENAME SAL
- 19,Alias,
- WHERE wkr.mgr = sup.empno ----------------------
- 20,Alias,
- AND wkr.sal > sup.sal; SCOTT 3000 JONES 2975
- 21,Alias,
- FORD 3000 JONES 2975
- 22,Alias,
-
- 23,Alias,
-
- 24,Alias,
- See also: select, select list, join, correlated query, menu.
- 1,Arithmetic Operators,
-
- 2,Arithmetic Operators,
-
- 3,Arithmetic Operators,
- Arithmetic and Character Operators
- 4,Arithmetic Operators,
-
- 5,Arithmetic Operators,
- Arithmetic operators in SQL manipulate and return numeric values; some
- 6,Arithmetic Operators,
- also handle date arithmetic.
- 7,Arithmetic Operators,
-
- 8,Arithmetic Operators,
- Operator Function Example
- 9,Arithmetic Operators,
- ------------------------------------------------------------------------
- 10,Arithmetic Operators,
- () Override precedence rules SELECT (x + y)/2...
- 11,Arithmetic Operators,
- + - Positive, negative value ...WHERE bal <= -50
- 12,Arithmetic Operators,
- * / Multiply, divide SELECT discount * 100...
- 13,Arithmetic Operators,
- + - Add, subtract SELECT price - discount...
- 14,Arithmetic Operators,
-
- 15,Arithmetic Operators,
-
- 16,Arithmetic Operators,
- The || character operator concatenates (puts together) CHAR (string)
- 17,Arithmetic Operators,
- values. Spaces are significant within 'apostrophes', but not outside
- 18,Arithmetic Operators,
- them. Note these expressions and examples of results they return:
- 19,Arithmetic Operators,
-
- 20,Arithmetic Operators,
- 'Contact '||fname || ' ' || lname Contact Daniel Altman
- 21,Arithmetic Operators,
- ename || ' gets '|| sal || per month King gets $5000 per month
- 22,Arithmetic Operators,
-
- 23,Arithmetic Operators,
- See also: char, comparison, like operator, logical operators,
- 24,Arithmetic Operators,
- set operators, other operators, menu.
- 1,Attributes,
-
- 2,Attributes,
-
- 3,Attributes,
- Attributes
- 4,Attributes,
-
- 5,Attributes,
- DECLARE
- 6,Attributes,
- variable1 table.column%TYPE
- 7,Attributes,
- variable2 variable_or_constant%TYPE
- 8,Attributes,
-
- 9,Attributes,
- Use the %TYPE attribute in declarations to set the datatype of any
- 10,Attributes,
- variable or constant to be the same as the datatype of an existing
- 11,Attributes,
- variable, constant, or column in a table. Benefit: You don't have
- 12,Attributes,
- to know the datatype or the parameters of a referenced column, and
- 13,Attributes,
- if you change the column, the variable's datatype changes also.
- 14,Attributes,
-
- 15,Attributes,
- Use %ROWTYPE in declaring a record variable to hold all data in a
- 16,Attributes,
- row of a table or view, or a row from a FETCH. Reference fields of
- 17,Attributes,
- records declared %ROWTYPE by using record_name.column_name.
- 18,Attributes,
- DECLARE
- 19,Attributes,
- CURSOR nextclient
- 20,Attributes,
- IS SELECT fname, lname, phone
- 21,Attributes,
- FROM clients;
- 22,Attributes,
- callrecord nextclient%ROWTYPE;...
- 23,Attributes,
- BEGIN
- 24,Attributes,
- OPEN nextclient;
- 25,Attributes,
- FETCH nextclient INTO callrecord;
- 26,Attributes,
-
- 27,Attributes,
- See also: declare, variables, fetch, cursors, menu.
- 1,BEGIN,
-
- 2,BEGIN,
-
- 3,BEGIN,
- BEGIN
- 4,BEGIN,
- PL/SQL statement
- 5,BEGIN,
- <<label_name>>
- 6,BEGIN,
- BEGIN
- 7,BEGIN,
- rest_of_block
- 8,BEGIN,
-
- 9,BEGIN,
-
- 10,BEGIN,
- BEGIN signals the completion of a block's DECLARE section (if any)
- 11,BEGIN,
- and starts the executable part of the block. Every block must have
- 12,BEGIN,
- at least one executable statement. Each BEGIN must have a matching
- 13,BEGIN,
- END statement to conclude the block.
- 14,BEGIN,
-
- 15,BEGIN,
- <<label_name>> is optional, but if you use one at the beginning of
- 16,BEGIN,
- a block, you must add the name to the END statement that concludes
- 17,BEGIN,
- that block.
- 18,BEGIN,
-
- 19,BEGIN,
-
- 20,BEGIN,
-
- 21,BEGIN,
- See also: blocks, declare, exception, end, commands, menu.
- 1,BNF Syntax,
-
- 2,BNF Syntax,
-
- 3,BNF Syntax,
- BNF Syntax
- 4,BNF Syntax,
-
- 5,BNF Syntax,
- {Braces} enclose required items; you MUST enter one from the list of
- 6,BNF Syntax,
- items separated by vertical bars. [Brackets] enclose optional items;
- 7,BNF Syntax,
- you MAY enter one from the list of items separated by vertical bars.
- 8,BNF Syntax,
- Three periods mean that the preceding item may be repeated. Do not
- 9,BNF Syntax,
- enter the braces, brackets, or vertical bars.
- 10,BNF Syntax,
-
- 11,BNF Syntax,
- Parentheses enclose parameter lists; commas separate items in a list.
- 12,BNF Syntax,
- UPPERCASE indicates specific words to be used; lowercase shows names
- 13,BNF Syntax,
- and expressions that vary.
- 14,BNF Syntax,
-
- 15,BNF Syntax,
- COMMIT [WORK]
- 16,BNF Syntax,
-
- 17,BNF Syntax,
- DELETE FROM [user.]table [alias] [WHERE condition]
- 18,BNF Syntax,
-
- 19,BNF Syntax,
- INSERT INTO [user.]table [ (column [, column]...) ]
- 20,BNF Syntax,
- { VALUES (value [, value]...) | query }
- 21,BNF Syntax,
-
- 22,BNF Syntax,
- LOCK TABLE [user.]table [, [user.]table ]...
- 23,BNF Syntax,
-
- 24,BNF Syntax,
- ROLLBACK [WORK] [TO [SAVEPOINT] savepoint]
- 25,BNF Syntax,
-
- 26,BNF Syntax,
- SAVEPOINT savepoint
- 27,BNF Syntax,
-
- 28,BNF Syntax,
- SELECT [ALL|DISTINCT] { * | table.* | expr [column_alias]}
- 29,BNF Syntax,
- [, {table.* | expr [column_alias] } ]... }
- 30,BNF Syntax,
- FROM [user.]table [table_alias] [,[user.]table [table_alias]]...
- 31,BNF Syntax,
- [ WHERE condition ]
- 32,BNF Syntax,
- [ CONNECT BY condition [START WITH condition] ]
- 33,BNF Syntax,
- [ GROUP BY expr[, expr]... [HAVING condition] ]
- 34,BNF Syntax,
- [ {UNION | INTERSECT | MINUS} SELECT ... ]
- 35,BNF Syntax,
- [ ORDER BY {expr | position} [ASC | DESC]
- 36,BNF Syntax,
- [, {expr | position} [ASC | DESC]] ]...
- 37,BNF Syntax,
- [ FOR UPDATE OF column [, column]... [NOWAIT] ]
- 38,BNF Syntax,
-
- 39,BNF Syntax,
- SET TRANSACTION [READ ONLY]
- 40,BNF Syntax,
-
- 41,BNF Syntax,
- UPDATE [user.]table [alias]
- 42,BNF Syntax,
- SET column = expr [, column = expr]...
- 43,BNF Syntax,
- [WHERE condition]
- 44,BNF Syntax,
-
- 45,BNF Syntax,
- UPDATE [user.]table [alias]
- 46,BNF Syntax,
- SET (column [, column] ... ) = (query) [,...]
- 47,BNF Syntax,
- [WHERE condition]
- 48,BNF Syntax,
-
- 49,BNF Syntax,
-
- 50,BNF Syntax,
- See any command listed above; see also: commands, identifiers, menu.
- 1,BOOLEAN,
-
- 2,BOOLEAN,
-
- 3,BOOLEAN,
- BOOLEAN
- 4,BOOLEAN,
-
- 5,BOOLEAN,
- BOOLEAN --no parameters
- 6,BOOLEAN,
-
- 7,BOOLEAN,
- Used only in PL/SQL, variables declared to be of the BOOLEAN datatype
- 8,BOOLEAN,
- may only contain one of the predefined constant values: TRUE, FALSE,
- 9,BOOLEAN,
- or NULL.
- 10,BOOLEAN,
-
- 11,BOOLEAN,
- You cannot retrieve a value into a BOOLEAN variable, nor can you
- 12,BOOLEAN,
- INSERT a BOOLEAN value into a database.
- 13,BOOLEAN,
-
- 14,BOOLEAN,
-
- 15,BOOLEAN,
-
- 16,BOOLEAN,
- See also: variables, boolean comparisons, menu.
- 1,BREAK,
-
- 2,BREAK,
-
- 3,BREAK,
- BREAK
- 4,BREAK,
-
- 5,BREAK,
- BRE[AK] [ON report_element [action [action]]] ...
- 6,BREAK,
-
- 7,BREAK,
- where report_element and action require the following syntax:
- 8,BREAK,
- report_element: {column | expression | ROW | REPORT}
- 9,BREAK,
- action: [SKI[P] n|[SKI[P]] PAGE] [NODUP[LICATES] | DUP[LICATES]]
- 10,BREAK,
-
- 11,BREAK,
- BREAK specifies where and how to make format changes to a report. You use
- 12,BREAK,
- BREAK to:
- 13,BREAK,
-
- 14,BREAK,
- - suppress the display of duplicate values for a given column
- 15,BREAK,
- - skip a line each time a given column value changes
- 16,BREAK,
- - COMPUTE figures when a given column value changes, or at the end
- 17,BREAK,
- of a report (see COMPUTE)
- 18,BREAK,
- - list the current BREAK definition (by issuing the BREAK command
- 19,BREAK,
- without any clauses following)
- 20,BREAK,
-
- 21,BREAK,
- BREAK also lists the current BREAK definition. Each new BREAK command
- 22,BREAK,
- replaces the preceding one.
- 23,BREAK,
-
- 24,BREAK,
- BREAK report_elements:
- 25,BREAK,
-
- 26,BREAK,
- ON column [action [action]]
- 27,BREAK,
- specifies action(s) for SQL*Plus to take when a break occurs in
- 28,BREAK,
- the break column. A break is:
- 29,BREAK,
-
- 30,BREAK,
- - a change in the value of a column or expression
- 31,BREAK,
- - the output of a row
- 32,BREAK,
- - the end of a report
- 33,BREAK,
-
- 34,BREAK,
- If you omit action(s), BREAK ON column suppresses printing of
- 35,BREAK,
- duplicate values in the column, marking in the report where
- 36,BREAK,
- SQL*Plus will perform the computation you specify in a matching
- 37,BREAK,
- COMPUTE command. You can specify ON column one or more times.
- 38,BREAK,
-
- 39,BREAK,
- Example: If you specify multiple ON clauses, as in:
- 40,BREAK,
-
- 41,BREAK,
- SQL> BREAK ON DEPTNO SKIP PAGE ON JOB SKIP 1 -
- 42,BREAK,
- > ON SAL SKIP 1
- 43,BREAK,
-
- 44,BREAK,
- the first ON clause is the outermost break (ON DEPTNO), and
- 45,BREAK,
- the last ON clause is the innermost break (ON SAL). SQL*Plus
- 46,BREAK,
- searches each output row for the break(s), starting with the
- 47,BREAK,
- outermost break and proceeding to the innermost in the order
- 48,BREAK,
- you've entered the clauses. In the example above, SQL*Plus
- 49,BREAK,
- searches for a change in the value of DEPTNO, then JOB, then
- 50,BREAK,
- SAL.
- 51,BREAK,
-
- 52,BREAK,
- Next, SQL*Plus executes the actions, beginning with the action
- 53,BREAK,
- for the innermost break and proceeding in reverse order toward
- 54,BREAK,
- the outermost break (from SKIP 1 for ON SAL toward SKIP PAGE
- 55,BREAK,
- for ON DEPTNO). SQL*Plus executes each action, including the
- 56,BREAK,
- action for the first occurring break found in the initial
- 57,BREAK,
- search.
- 58,BREAK,
-
- 59,BREAK,
- If, for example, the value of JOB in a given row changes, but
- 60,BREAK,
- the values of DEPTNO and SAL stay the same, SQL*Plus skips two
- 61,BREAK,
- lines before printing the row: one as a result of SKIP 1 in
- 62,BREAK,
- the ON SAL clause, the other as a result of SKIP 1 in the
- 63,BREAK,
- ON JOB clause.
- 64,BREAK,
-
- 65,BREAK,
- When you use ON column, you should also use the ORDER BY clause
- 66,BREAK,
- in the SELECT statement. The columns usually should appear in
- 67,BREAK,
- the same order in ORDER BY as they do in BREAK, so that breaks
- 68,BREAK,
- do not occur at meaningless points in the report. All the
- 69,BREAK,
- columns listed in ORDER BY need not appear in the BREAK command.
- 70,BREAK,
-
- 71,BREAK,
-
- 72,BREAK,
- The following SELECT produces meaningful results with the above
- 73,BREAK,
- BREAK:
- 74,BREAK,
-
- 75,BREAK,
- SQL> SELECT DEPTNO, JOB, SAL,ENAME
- 76,BREAK,
- 2 FROM EMP
- 77,BREAK,
- 3 ORDER BY DEPTNO, JOB, SAL, ENAME;
- 78,BREAK,
-
- 79,BREAK,
-
- 80,BREAK,
- All rows with the same DEPTNO print together on one page, and
- 81,BREAK,
- within that page all rows with the same JOB print in groups.
- 82,BREAK,
- Within each group of jobs, those with the same SAL print in
- 83,BREAK,
- groups. Breaks in ENAME cause no action, because ENAME does
- 84,BREAK,
- not appear in the BREAK command.
- 85,BREAK,
-
- 86,BREAK,
- ON expr [action [action]]
- 87,BREAK,
- specifies action(s) for SQL*Plus to take when the value of the
- 88,BREAK,
- expression changes. If action(s) are omitted, BREAK ON expr
- 89,BREAK,
- suppresses printing of duplicate values of expr, marking in the
- 90,BREAK,
- report the place where SQL*Plus will perform the computation you
- 91,BREAK,
- specify in a matching COMPUTE command.
- 92,BREAK,
-
- 93,BREAK,
- You can use an expression involving one or more table columns, or
- 94,BREAK,
- an alias assigned to a report column in a SELECT statement or a
- 95,BREAK,
- COLUMN command. If you use an expression in a BREAK command, you
- 96,BREAK,
- must enter expr exactly as it appears in SELECT; if the expression
- 97,BREAK,
- in the SELECT statement is a+b, for example, you cannot use b+a or
- 98,BREAK,
- (a+b) in a BREAK command to refer to the expression in the SELECT
- 99,BREAK,
- statement. The information for ON column also applies to ON expr.
- 100,BREAK,
-
- 101,BREAK,
- ON ROW [action [action]]
- 102,BREAK,
- specifies action(s) for SQL*Plus to take when a SELECT statement
- 103,BREAK,
- returns a row. The ROW break becomes the innermost break no matter
- 104,BREAK,
- where it appears in the BREAK command. You should always specify
- 105,BREAK,
- an action when you BREAK on a row.
- 106,BREAK,
-
- 107,BREAK,
- ON REPORT
- 108,BREAK,
- marks in a report the place where SQL*Plus will perform the
- 109,BREAK,
- computation specified in a matching COMPUTE command. Use BREAK
- 110,BREAK,
- ON REPORT with COMPUTE to print grand totals or other "grand"
- 111,BREAK,
- computed values. The REPORT break becomes the outermost break
- 112,BREAK,
- regardless of where you specify it in the BREAK command.
- 113,BREAK,
-
- 114,BREAK,
- BREAK actions:
- 115,BREAK,
-
- 116,BREAK,
- SKI[P] n
- 117,BREAK,
- skips n lines before printing the row where the break occurred.
- 118,BREAK,
-
- 119,BREAK,
- [SKI[P]] PAGE
- 120,BREAK,
- skips to a new page before printing the row where break occurred.
- 121,BREAK,
-
- 122,BREAK,
- NODUP[LICATES]
- 123,BREAK,
- prints blanks rather than the value of a break column when the
- 124,BREAK,
- value is a duplicate of the column's value in the preceding row.
- 125,BREAK,
-
- 126,BREAK,
- DUP[LICATES]
- 127,BREAK,
- prints the value of a break column in every selected row.
- 128,BREAK,
-
- 129,BREAK,
- Example: The example report below, produces prints duplicate
- 130,BREAK,
- job values, prints the average of SAL, inserts one blank line
- 131,BREAK,
- when the JOB value changes, and (when the value of DEPTNO
- 132,BREAK,
- changes) prints the sum of SAL and inserts another blank line:
- 133,BREAK,
-
- 134,BREAK,
- SQL> BREAK ON DEPTNO SKIP 1 ON JOB SKIP 1 DUPLICATES
- 135,BREAK,
- SQL> COMPUTE SUM OF SAL ON DEPTNO
- 136,BREAK,
- SQL> COMPUTE AVG OF SAL ON JOB
- 137,BREAK,
- SQL> SELECT DEPTNO, JOB, ENAME, SAL FROM EMP
- 138,BREAK,
- 2 WHERE JOB IN ('CLERK', 'SALESMAN')
- 139,BREAK,
- 3 AND DEPTNO IN (10, 30)
- 140,BREAK,
- 4 ORDER BY DEPTNO, JOB;
- 141,BREAK,
-
- 142,BREAK,
- Output:
- 143,BREAK,
-
- 144,BREAK,
- DEPTNO JOB ENAME SAL
- 145,BREAK,
- ------ --------- --------- ------
- 146,BREAK,
- 10 CLERK MILLER 1300
- 147,BREAK,
- ******** ------
- 148,BREAK,
- avg 1300
- 149,BREAK,
-
- 150,BREAK,
- ****** ------
- 151,BREAK,
- sum 1300
- 152,BREAK,
-
- 153,BREAK,
- 30 CLERK JAMES 1045
- 154,BREAK,
- ******** ------
- 155,BREAK,
- avg 1045
- 156,BREAK,
-
- 157,BREAK,
- SALESMAN ALLEN 1760
- 158,BREAK,
- SALESMAN MARTIN 1375
- 159,BREAK,
- SALESMAN TURNER 1650
- 160,BREAK,
- SALESMAN WARD 1375
- 161,BREAK,
- ******** ------
- 162,BREAK,
- avg 1540
- 163,BREAK,
-
- 164,BREAK,
- ****** ------
- 165,BREAK,
- sum 7205
- 166,BREAK,
-
- 167,BREAK,
- See also: compute, order by, select, SQL in PL/SQL, commands, menu.
- 1,BTITLE,
-
- 2,BTITLE,
-
- 3,BTITLE,
- BTITLE
- 4,BTITLE,
-
- 5,BTITLE,
- BTI[TLE] [printspec [text | variable] ...] | [OFF|ON]
- 6,BTITLE,
-
- 7,BTITLE,
- BTITLE places and formats a title at the bottom of each report page, or
- 8,BTITLE,
- lists the current BTITLE definition. See TTITLE for a description of
- 9,BTITLE,
- BTITLE clauses, and to learn how to print page numbers in the title. To
- 10,BTITLE,
- list the current BTITLE definition, enter BTITLE with no clauses.
- 11,BTITLE,
-
- 12,BTITLE,
- SQL*Plus interprets BTITLE in the "new" form if a valid printspec clause
- 13,BTITLE,
- (LEFT, SKIP, COL, etc.) immediately follows BTITLE. See OLD (BTITLE) for
- 14,BTITLE,
- a description of an alternative form of BTITLE.
- 15,BTITLE,
-
- 16,BTITLE,
- Examples: To set a bottom title with CORPORATE PLANNING DEPARTMENT on the
- 17,BTITLE,
- left and a date on the right, enter:
- 18,BTITLE,
-
- 19,BTITLE,
- SQL> BTITLE LEFT 'CORPORATE PLANNING DEPARTMENT' -
- 20,BTITLE,
- > RIGHT '11 Jan 1990'
- 21,BTITLE,
-
- 22,BTITLE,
- To set a bottom title with CONFIDENTIAL in column 50, followed
- 23,BTITLE,
- by six spaces and a date, enter:
- 24,BTITLE,
-
- 25,BTITLE,
- SQL> BTITLE COL 50 'CONFIDENTIAL' TAB 6 '11 Jan 90'
- 26,BTITLE,
-
- 27,BTITLE,
- See also: old btitle, ttitle, commands, menu.
- 1,Blocks,
-
- 2,Blocks,
-
- 3,Blocks,
- Blocks
- 4,Blocks,
-
- 5,Blocks,
- DECLARE --Main block
- 6,Blocks,
- variable_name1 datatype (expr); --variables, constants, cursors
- 7,Blocks,
- ... & exceptions may be declared;
- 8,Blocks,
- BEGIN DECLARE section is optional.
- 9,Blocks,
- DECLARE --First sub-block
- 10,Blocks,
- variable_name2 datatype (expr)...; --You may nest blocks in
- 11,Blocks,
- BEGIN each other to any level.
- 12,Blocks,
- executable_statements...;
- 13,Blocks,
- EXCEPTION exception_handlers; --EXCEPTION section is optional.
- 14,Blocks,
- END;
- 15,Blocks,
- DECLARE --Second sub-block
- 16,Blocks,
- variable_name3 datatype (expr)...;
- 17,Blocks,
- BEGIN
- 18,Blocks,
- executable_statements...;
- 19,Blocks,
- END;
- 20,Blocks,
- EXCEPTION exception_handlers;
- 21,Blocks,
- END;
- 22,Blocks,
-
- 23,Blocks,
-
- 24,Blocks,
- See also: declare, begin, scoping rules, variables, error handling, menu.
- 1,Boolean Comparisons,
-
- 2,Boolean Comparisons,
-
- 3,Boolean Comparisons,
- Boolean Comparisons
- 4,Boolean Comparisons,
-
- 5,Boolean Comparisons,
- Boolean comparisons use comparison operators to set conditions. These
- 6,Boolean Comparisons,
- comparisons are used with flow of control statements in PL/SQL:
- 7,Boolean Comparisons,
-
- 8,Boolean Comparisons,
- Oper With Numbers With Characters With Dates
- 9,Boolean Comparisons,
- --------------------------------------------------------------------------
- 10,Boolean Comparisons,
- < is less than alphabetically before is earlier than
- 11,Boolean Comparisons,
- > is greater than alphabetically after is later than
- 12,Boolean Comparisons,
- = is equal to is the same as is the same as
- 13,Boolean Comparisons,
- != is not equal to is not the same as is not the same as
- 14,Boolean Comparisons,
- <= less than or equal before or same as earlier or same as
- 15,Boolean Comparisons,
- >= greater than or equal after or same as later or same as
- 16,Boolean Comparisons,
-
- 17,Boolean Comparisons,
-
- 18,Boolean Comparisons,
- You can also compare variables declared as BOOLEAN: TRUE > FALSE
- 19,Boolean Comparisons,
- FALSE < TRUE
- 20,Boolean Comparisons,
- TRUE != FALSE
- 21,Boolean Comparisons,
-
- 22,Boolean Comparisons,
-
- 23,Boolean Comparisons,
- See also: comparison operators, conditions, boolean, menu.
- 1,Buffer,
-
- 2,Buffer,
-
- 3,Buffer,
- Buffer
- 4,Buffer,
-
- 5,Buffer,
- SQL Commands
- 6,Buffer,
- SQL commands you enter are stored in the SQL buffer. You can continue
- 7,Buffer,
- a SQL command on one or more additional lines, ending and executing
- 8,Buffer,
- the command with a semicolon (;), a blank line, or a slash (/) on a
- 9,Buffer,
- line by itself. SQL*Plus displays line numbers (matching the lines in
- 10,Buffer,
- the SQL buffer) for these additional lines. Use SAVE to store the
- 11,Buffer,
- buffer's contents in a file. Use RUN or / (slash) at the command
- 12,Buffer,
- prompt to execute commands in the SQL buffer.
- 13,Buffer,
-
- 14,Buffer,
- PL/SQL Blocks
- 15,Buffer,
- SQL*Plus also stores PL/SQL programs (blocks) in the SQL buffer.
- 16,Buffer,
- To end a PL/SQL block, enter a . (period) by itself on a new line.
- 17,Buffer,
- Execute a block in the buffer with RUN or / (slash). You can use
- 18,Buffer,
- REMARK and /*comments*/ with PL/SQL blocks as with SQL commands.
- 19,Buffer,
- In PL/SQL, you can also use "--" (two dashes) to begin a comment
- 20,Buffer,
- that ends with the next RETURN character.
- 21,Buffer,
-
- 22,Buffer,
- SQL*Plus Commands
- 23,Buffer,
- Continue a long SQL*Plus command on additional lines by using a -
- 24,Buffer,
- (hyphen) at the end of each line; SQL*Plus prompts with a > for the
- 25,Buffer,
- next line. A line not ended by a hyphen executes the command.
- 26,Buffer,
-
- 27,Buffer,
-
- 28,Buffer,
- Example: If you enter the COLUMN command:
- 29,Buffer,
-
- 30,Buffer,
- SQL> COLUMN ENAME HEADING EMPLOYEES -
- 31,Buffer,
- > FORMAT A10
- 32,Buffer,
- SQL>
- 33,Buffer,
-
- 34,Buffer,
- You can end a SQL*Plus command with ; (semicolon). It's not required.
- 35,Buffer,
- SQL*Plus commands are not stored in the SQL buffer. Use EDIT to create
- 36,Buffer,
- command files containing SQL*Plus commands. START runs a command file.
- 37,Buffer,
- Use REMARK to enter comments within SQL*Plus commands. You can also
- 38,Buffer,
- use /*comment delimiters*/ on a separate line before or after a
- 39,Buffer,
- SQL*Plus command, but not on the same line.
- 40,Buffer,
-
- 41,Buffer,
-
- 42,Buffer,
- See also: substitution, commands, menu.
- 1,CHANGE,
-
- 2,CHANGE,
-
- 3,CHANGE,
- CHANGE
- 4,CHANGE,
-
- 5,CHANGE,
- C[HANGE] sepchar old [sepchar [new[sepchar]]]
- 6,CHANGE,
-
- 7,CHANGE,
- Use CHANGE to replace the text you specify from the current line of the
- 8,CHANGE,
- buffer with the new text you specify.
- 9,CHANGE,
-
- 10,CHANGE,
- sepchar
- 11,CHANGE,
- is any non-alphanumeric character such as "/" or "!". You can
- 12,CHANGE,
- use any sepchar that does not appear in "old" or "new". The
- 13,CHANGE,
- space between CHANGE and the first sepchar is optional.
- 14,CHANGE,
-
- 15,CHANGE,
- old
- 16,CHANGE,
- is the text you wish to change. CHANGE ignores case in searching
- 17,CHANGE,
- for old. For example, CHANGE /aq/aw finds the first occurrence
- 18,CHANGE,
- of "aq", "AQ", "aQ", or "Aq", and changes it to "aw". SQL*Plus
- 19,CHANGE,
- inserts the new text exactly as you specify it.
- 20,CHANGE,
-
- 21,CHANGE,
- If old is prefixed with "...", it matches everything up to and
- 22,CHANGE,
- including the first occurrence of old. If it is suffixed with
- 23,CHANGE,
- "...", it matches the first occurrence of old and everything that
- 24,CHANGE,
- follows on that line. If it contains an embedded "...", it
- 25,CHANGE,
- matches everything from the preceding part of old through the
- 26,CHANGE,
- following part of old.
- 27,CHANGE,
-
- 28,CHANGE,
- new
- 29,CHANGE,
- is the text with which you wish to replace old. If you omit new
- 30,CHANGE,
- and, optionally, the second and third sepchars, CHANGE deletes old
- 31,CHANGE,
- from the current line of the buffer.
- 32,CHANGE,
-
- 33,CHANGE,
- CHANGE changes text on the current line in the buffer. The current line
- 34,CHANGE,
- is marked with an asterisk (*) in the LIST output. You can also use
- 35,CHANGE,
- CHANGE to modify a line in the buffer that has caused an ORACLE error;
- 36,CHANGE,
- SQL*Plus makes the erroneous line, the current line. To re-enter an
- 37,CHANGE,
- entire line, type its number, then the new contents of the line. Entering
- 38,CHANGE,
- a line number larger than the number of lines in the buffer causes
- 39,CHANGE,
- SQL*Plus to add the text in a new line at the end of the buffer. Entering
- 40,CHANGE,
- 0 for the line number causes SQL*Plus insert that line before the other
- 41,CHANGE,
- lines (it becomes line 1).
- 42,CHANGE,
-
- 43,CHANGE,
- Examples: The current line of the buffer contains the following text:
- 44,CHANGE,
-
- 45,CHANGE,
- 4* WHERE JOB IS IN ('CLERK','ANALYST')
- 46,CHANGE,
-
- 47,CHANGE,
- Entering this... Changes the buffer text to this.
- 48,CHANGE,
- -----------------------------------------------------------------------
- 49,CHANGE,
- SQL> C /ANALYST/GUARD/ 4* WHERE JOB IS IN ('CLERK','GUARD')
- 50,CHANGE,
-
- 51,CHANGE,
- SQL> C /'CLERK',.../'CLERK')/ 4* WHERE JOB IS IN ('CLERK')
- 52,CHANGE,
-
- 53,CHANGE,
- SQL> C /(...)/('COOK','BUTLER')/ 4* WHERE JOB IS IN ('COOK','BUTLER')
- 54,CHANGE,
-
- 55,CHANGE,
-
- 56,CHANGE,
- Use the line number to replace an entire line. If you enter:
- 57,CHANGE,
-
- 58,CHANGE,
- SQL> 2 FROM EMP e1
- 59,CHANGE,
-
- 60,CHANGE,
- the second line of the buffer is replaced with:
- 61,CHANGE,
-
- 62,CHANGE,
- FROM EMP e1
- 63,CHANGE,
-
- 64,CHANGE,
-
- 65,CHANGE,
- NOTE: Entering a line number and a string always replaces the line
- 66,CHANGE,
- with the string, no matter what the text of the string:
- 67,CHANGE,
-
- 68,CHANGE,
- SQL> 2 c/old/new/
- 69,CHANGE,
-
- 70,CHANGE,
- changes the second line of the buffer to:
- 71,CHANGE,
-
- 72,CHANGE,
- c/old/new
- 73,CHANGE,
-
- 74,CHANGE,
-
- 75,CHANGE,
- See also: append, del, edit, input, list, save, set (SQL buffer) spool,
- 76,CHANGE,
- commands, menu.
- 1,CHAR,
-
- 2,CHAR,
-
- 3,CHAR,
- CHAR
- 4,CHAR,
-
- 5,CHAR,
- CHAR(size) --(size) optional; if omitted, defaults to 1
- 6,CHAR,
-
- 7,CHAR,
- Columns and variables defined to be CHAR store characters as strings.
- 8,CHAR,
- Size determines the number of characters allowed; the maximum is 255.
- 9,CHAR,
-
- 10,CHAR,
-
- 11,CHAR,
- See also: conversion, variables, number, long, date, boolean, raw, menu.
- 1,CLEAR,
-
- 2,CLEAR,
-
- 3,CLEAR,
- CLEAR
- 4,CLEAR,
-
- 5,CLEAR,
- CL[EAR] option
- 6,CLEAR,
-
- 7,CLEAR,
- CLEAR resets or erases the current value or setting for the option, where
- 8,CLEAR,
- option is one of the following clauses:
- 9,CLEAR,
-
- 10,CLEAR,
- BRE[AKS]
- 11,CLEAR,
- clears breaks set by the BREAK command.
- 12,CLEAR,
-
- 13,CLEAR,
- BUFF[ER]
- 14,CLEAR,
- clears text from the buffer. CLEAR BUFFER works like CLEAR SQL,
- 15,CLEAR,
- unless you are using multiple buffers.
- 16,CLEAR,
-
- 17,CLEAR,
- COL[UMNS]
- 18,CLEAR,
- clears options set by the COLUMN command for all columns. To clear
- 19,CLEAR,
- settings for a single column, use the CLEAR clause of the COLUMN
- 20,CLEAR,
- command.
- 21,CLEAR,
-
- 22,CLEAR,
- COMP[UTES]
- 23,CLEAR,
- clears options set by the COMPUTE command.
- 24,CLEAR,
-
- 25,CLEAR,
- SCR[EEN]
- 26,CLEAR,
- clears your screen.
- 27,CLEAR,
-
- 28,CLEAR,
- SQL
- 29,CLEAR,
- clears text from the SQL buffer. CLEAR SQL works the same as
- 30,CLEAR,
- CLEAR BUFFER, unless you are using multiple buffers.
- 31,CLEAR,
-
- 32,CLEAR,
- TIMI[NG]
- 33,CLEAR,
- deletes all timing areas created by the TIMING command.
- 34,CLEAR,
-
- 35,CLEAR,
-
- 36,CLEAR,
- Examples: To clear breaks, enter:
- 37,CLEAR,
-
- 38,CLEAR,
- SQL> CLEAR BRE
- 39,CLEAR,
-
- 40,CLEAR,
-
- 41,CLEAR,
- To clear column elements, enter:
- 42,CLEAR,
-
- 43,CLEAR,
- SQL> CLEAR COL
- 44,CLEAR,
-
- 45,CLEAR,
-
- 46,CLEAR,
- See also: break, buffer, column, compute, set (SQL buffer, timing),
- 47,CLEAR,
- commands, menu.
- 1,CLOSE,
-
- 2,CLOSE,
-
- 3,CLOSE,
- CLOSE
- 4,CLOSE,
- PL/SQL statement
- 5,CLOSE,
- CLOSE cursor_name;
- 6,CLOSE,
-
- 7,CLOSE,
-
- 8,CLOSE,
- Use the CLOSE statement to disable the cursor, leaving the active
- 9,CLOSE,
- set undefined. Cursor_name must be an explicitly declared cursor
- 10,CLOSE,
- that is currently open.
- 11,CLOSE,
-
- 12,CLOSE,
-
- 13,CLOSE,
- Once it's been closed, to FETCH from a cursor you must reopen it.
- 14,CLOSE,
- The system then:
- 15,CLOSE,
-
- 16,CLOSE,
- - executes the OPEN statement
- 17,CLOSE,
- - reevaluates all parameters
- 18,CLOSE,
- - reinitializes the active set (rows retrieved by the query).
- 19,CLOSE,
-
- 20,CLOSE,
-
- 21,CLOSE,
- See also: fetch, open, query, cursors, commands, menu.
- 1,COLUMN,
-
- 2,COLUMN,
-
- 3,COLUMN,
- COLUMN
- 4,COLUMN,
-
- 5,COLUMN,
- COL[UMN] [{column | expr} [option...] ]
- 6,COLUMN,
-
- 7,COLUMN,
- where option is one of the following:
- 8,COLUMN,
-
- 9,COLUMN,
- ALI[AS] alias
- 10,COLUMN,
- CLE[AR] | DEF[AULT]
- 11,COLUMN,
- COLOR {color | color_variable}
- 12,COLUMN,
- FOLD_A[FTER] n
- 13,COLUMN,
- FOLD_B[EFORE] n
- 14,COLUMN,
- FOR[MAT] format
- 15,COLUMN,
- HEA[DING] text
- 16,COLUMN,
- JUS[TIFY] {L[EFT] | C[ENTER] | C[ENTRE] | R[IGHT]}
- 17,COLUMN,
- LIKE {expr | alias}
- 18,COLUMN,
- LINEAPP {LINE | MARK | BOTH}
- 19,COLUMN,
- NEWL[INE]
- 20,COLUMN,
- NEW_V[ALUE] variable
- 21,COLUMN,
- NOPRI[NT] | PRI[NT]
- 22,COLUMN,
- NUL[L] char
- 23,COLUMN,
- OLD_V[ALUE] variable
- 24,COLUMN,
- ON|OFF
- 25,COLUMN,
- PATTERN {pattern_number | pattern_variable}
- 26,COLUMN,
- WRA[PPED] | WOR[D_WRAPPED] | TRU[NCATED]
- 27,COLUMN,
-
- 28,COLUMN,
- COLUMN sets display attributes for a given column, such as:
- 29,COLUMN,
-
- 30,COLUMN,
- - text for the column heading
- 31,COLUMN,
- - alignment of the column heading
- 32,COLUMN,
- - format for NUMBER data
- 33,COLUMN,
- - wrapping of column data
- 34,COLUMN,
-
- 35,COLUMN,
- Enter COLUMN with column or expr to list the current display attributes
- 36,COLUMN,
- for only the column or expression specified. Enter COLUMN with no clauses
- 37,COLUMN,
- to list all current column display attributes.
- 38,COLUMN,
-
- 39,COLUMN,
- {column | expr}
- 40,COLUMN,
- identifies the data item (typically, the column name) in a SELECT
- 41,COLUMN,
- statement to which the column command refers. You must enter an
- 42,COLUMN,
- expression exactly as it appears in the SQL SELECT statement if
- 43,COLUMN,
- you use it in a COLUMN command. For example, if the expression
- 44,COLUMN,
- in the SELECT statement is a+b, you cannot use b+a or (a+b) in a
- 45,COLUMN,
- COLUMN command to refer to the expression in the SELECT statement.
- 46,COLUMN,
-
- 47,COLUMN,
- If you select columns with the same name from different tables, a
- 48,COLUMN,
- COLUMN command for that column name will apply to both columns.
- 49,COLUMN,
- That is, a COLUMN command for the column ENAME applies to all
- 50,COLUMN,
- columns named ENAME that you reference in this session. COLUMN
- 51,COLUMN,
- ignores table name prefixes in SELECT statements.
- 52,COLUMN,
-
- 53,COLUMN,
- To format the columns differently, assign a unique alias to each
- 54,COLUMN,
- column within the SELECT statement itself (do not use the ALIAS
- 55,COLUMN,
- clause of the COLUMN command) and enter a COLUMN command for each
- 56,COLUMN,
- column's alias.
- 57,COLUMN,
-
- 58,COLUMN,
- ALI[AS] alias
- 59,COLUMN,
- assigns a specified alias to a column, which can be used to refer
- 60,COLUMN,
- to the column in BREAK, COMPUTE, and other COLUMN commands.
- 61,COLUMN,
-
- 62,COLUMN,
- CLE[AR] | DEF[AULT]
- 63,COLUMN,
- resets the display attributes for the column to default values.
- 64,COLUMN,
-
- 65,COLUMN,
- COLOR {color|color_variable}
- 66,COLUMN,
- is described in the SQL*Graph User's Guide.
- 67,COLUMN,
-
- 68,COLUMN,
- FOLD_A[FTER] n
- 69,COLUMN,
- inserts a carriage return after the column heading and after each
- 70,COLUMN,
- row in the column. You must enter n; the particular value you
- 71,COLUMN,
- choose for n has no effect on the format.
- 72,COLUMN,
-
- 73,COLUMN,
- FOLD_B[EFORE] n
- 74,COLUMN,
- inserts a carriage return before the column heading and before
- 75,COLUMN,
- each row of the column. You must enter n; the particular value
- 76,COLUMN,
- you choose for n has no effect on the format. FOLD_BEFORE n has
- 77,COLUMN,
- the same effect as NEWLINE.
- 78,COLUMN,
-
- 79,COLUMN,
- FOR[MAT] format
- 80,COLUMN,
- sets the display format of the column. The format specification
- 81,COLUMN,
- must be a text constant such as $9,999 or A10, not a variable.
- 82,COLUMN,
-
- 83,COLUMN,
- A CHAR column's width defaults to the column's width as defined in
- 84,COLUMN,
- the database or to the length of the column's heading, whichever
- 85,COLUMN,
- is longer. A LONG column's width defaults to the value of SET
- 86,COLUMN,
- LONG. To change the width of a CHAR or LONG column to n, use
- 87,COLUMN,
- FORMAT An. If you specify a width shorter than the column
- 88,COLUMN,
- heading, SQL*Plus truncates the heading.
- 89,COLUMN,
-
- 90,COLUMN,
- SQL*Plus formats CHAR data left-justified. If a value does not
- 91,COLUMN,
- fit within the column width, SQL*Plus wraps or truncates the
- 92,COLUMN,
- character string depending on the setting of SET WRAP.
- 93,COLUMN,
-
- 94,COLUMN,
- The default width for unformatted DATE columns in SQL*Plus is A9.
- 95,COLUMN,
- To change the format of a DATE column, use the SQL function
- 96,COLUMN,
- TO_CHAR in your SQL SELECT statement.
- 97,COLUMN,
-
- 98,COLUMN,
- When you use TO_CHAR, ORACLE automatically allows for a very wide
- 99,COLUMN,
- column, so SQL*Plus sets the column width to 80 characters. Use
- 100,COLUMN,
- the COLUMN command to reset the width of the column. To change
- 101,COLUMN,
- the width of a DATE column to n, use FORMAT An. If you specify a
- 102,COLUMN,
- width shorter than the column heading, the heading is truncated.
- 103,COLUMN,
-
- 104,COLUMN,
- NOTE: Other SQL calculations may cause a similar effect; in that
- 105,COLUMN,
- case, use the SQL*Plus COLUMN command to reset the column width.
- 106,COLUMN,
-
- 107,COLUMN,
- A NUMBER column's width defaults to the value of SET NUMWIDTH. To
- 108,COLUMN,
- change the width, use FORMAT followed by a number format element.
- 109,COLUMN,
- See FORMATS FOR NUMBERS.
- 110,COLUMN,
-
- 111,COLUMN,
- SQL*Plus formats NUMBER data right-justified. The field width
- 112,COLUMN,
- equals the width of the heading or the format plus one space for
- 113,COLUMN,
- the sign, whichever is greater. SQL*Plus never truncates a NUMBER
- 114,COLUMN,
- column heading. If a value does not fit within the column width,
- 115,COLUMN,
- SQL*Plus displays an asterisk (*) in place of each digit the width
- 116,COLUMN,
- allows to indicate overflow.
- 117,COLUMN,
-
- 118,COLUMN,
- With all number formats, SQL*Plus rounds a number to the specified
- 119,COLUMN,
- number of significant digits. When no format is given, a number's
- 120,COLUMN,
- width defaults to the value of NUMWIDTH. See the SET command.
- 121,COLUMN,
-
- 122,COLUMN,
- HEA[DING] text
- 123,COLUMN,
- defines a column heading. If text contains blanks or punctuation
- 124,COLUMN,
- characters, you must enclose it with single or double quotes. If
- 125,COLUMN,
- you omit a HEADING clause, the column's heading defaults to column
- 126,COLUMN,
- or expr. Each occurrence of the HEADSEP character (default = '|')
- 127,COLUMN,
- begins a new line. For example,
- 128,COLUMN,
-
- 129,COLUMN,
- COLUMN ENAME HEADING 'Employee |Name'
- 130,COLUMN,
-
- 131,COLUMN,
- produces a two-line column heading. See the SET command's HEADSEP
- 132,COLUMN,
- variable for information on changing the HEADSEP character.
- 133,COLUMN,
-
- 134,COLUMN,
- JUS[TIFY] {L[EFT]|C[ENTER]|C[ENTRE]|R[IGHT]}
- 135,COLUMN,
- aligns the heading. If you do not use a JUSTIFY clause, NUMBER
- 136,COLUMN,
- columns default to RIGHT and other column types default to LEFT.
- 137,COLUMN,
-
- 138,COLUMN,
- LIKE {expr|alias}
- 139,COLUMN,
- copies the display attributes of another column or expression
- 140,COLUMN,
- (whose attributes you've defined with another COLUMN command).
- 141,COLUMN,
- LIKE copies only attributes not defined by another clause in the
- 142,COLUMN,
- current COLUMN command.
- 143,COLUMN,
-
- 144,COLUMN,
- LINEAPP {LINE|MARK|BOTH}
- 145,COLUMN,
- is described in the SQL*Graph User's Guide.
- 146,COLUMN,
-
- 147,COLUMN,
- NEWL[INE]
- 148,COLUMN,
- starts a new line before displaying the column's value. NEWLINE
- 149,COLUMN,
- has the same effect as FOLD_BEFORE n.
- 150,COLUMN,
-
- 151,COLUMN,
- NEW_V[ALUE] variable
- 152,COLUMN,
- specifies a variable to hold a column value, so you can reference
- 153,COLUMN,
- the variable in TTITLE commands. Use NEW_VALUE to display column
- 154,COLUMN,
- values or the date in the top title. You must include the column
- 155,COLUMN,
- in a BREAK command with the SKIP PAGE action.
- 156,COLUMN,
-
- 157,COLUMN,
- NEW_VALUE is useful for master/detail reports in which there is a
- 158,COLUMN,
- new master record for each page. For master/detail reporting, you
- 159,COLUMN,
- must also include the column in the ORDER BY clause.
- 160,COLUMN,
-
- 161,COLUMN,
- For information on displaying a column value in the bottom title,
- 162,COLUMN,
- see COLUMN OLD_VALUE below. See TTITLE for more information on
- 163,COLUMN,
- referencing variables in titles. See COLUMN FORMAT above for
- 164,COLUMN,
- details on formatting and valid format models.
- 165,COLUMN,
-
- 166,COLUMN,
- NOPRI[NT]|PRI[NT]
- 167,COLUMN,
- controls the printing of the column (the column heading and all
- 168,COLUMN,
- the selected values). NOPRINT turns the printing of the column
- 169,COLUMN,
- off; PRINT turns it on.
- 170,COLUMN,
-
- 171,COLUMN,
- NUL[L] char
- 172,COLUMN,
- controls the text SQL*Plus displays for null values in the given
- 173,COLUMN,
- column. If you do not use a NULL clause in the COLUMN command,
- 174,COLUMN,
- SQL*Plus displays blanks or the text to which you have set NULL
- 175,COLUMN,
- using the SET command whenever a null value is encountered in the
- 176,COLUMN,
- given column. (SET NULL controls the text displayed for all null
- 177,COLUMN,
- values for all columns, unless overridden for a specific column by
- 178,COLUMN,
- the NULL clause of the COLUMN command.)
- 179,COLUMN,
-
- 180,COLUMN,
- OLD_V[ALUE] variable
- 181,COLUMN,
- specifies a variable to hold a column value, so you can reference
- 182,COLUMN,
- the variable in BTITLE commands. Use OLD_VALUE to display column
- 183,COLUMN,
- values or the date in the bottom title. You must include the
- 184,COLUMN,
- column in a BREAK command with the SKIP PAGE action.
- 185,COLUMN,
-
- 186,COLUMN,
- OLD_VALUE is useful for master/detail reports in which there is a
- 187,COLUMN,
- new master record for each page. For master/detail reporting, you
- 188,COLUMN,
- must also include the column in the ORDER BY clause.
- 189,COLUMN,
-
- 190,COLUMN,
- See COLUMN NEW_VALUE above for information on displaying a column
- 191,COLUMN,
- value in the top title. See TTITLE for more on referencing
- 192,COLUMN,
- variables in titles. See COLUMN FORMAT above for details on
- 193,COLUMN,
- formatting and valid format models.
- 194,COLUMN,
-
- 195,COLUMN,
- ON|OFF
- 196,COLUMN,
- controls the status of display attributes for a column. OFF
- 197,COLUMN,
- disables the attributes for a column without affecting the
- 198,COLUMN,
- attributes' definition. ON reinstates the attributes.
- 199,COLUMN,
-
- 200,COLUMN,
- PATTERN {pattern_number|pattern_variable}
- 201,COLUMN,
- is described in the SQL*Graph User's Guide.
- 202,COLUMN,
-
- 203,COLUMN,
- WRA[PPED]| WOR[D_WRAPPED]|TRU[NCATED]
- 204,COLUMN,
- specifies how SQL*Plus treats a CHAR string that is too wide for a
- 205,COLUMN,
- column. WRAPPED moves the end of the string to the next line.
- 206,COLUMN,
- WORD_WRAP moves an entire word to the next line rather than
- 207,COLUMN,
- splitting the word. TRUNCATED cuts off the string at the end of
- 208,COLUMN,
- the first display line.
- 209,COLUMN,
-
- 210,COLUMN,
-
- 211,COLUMN,
- You can enter any number of COLUMN commands for one or more columns. All
- 212,COLUMN,
- column attributes set for each column remain in effect for the remainder
- 213,COLUMN,
- of the session, or until you turn the column OFF. Thus, the COLUMN
- 214,COLUMN,
- commands you enter can control a column's display attributes for multiple
- 215,COLUMN,
- SQL SELECT statements. When you enter multiple COLUMN commands for the
- 216,COLUMN,
- same column, SQL*Plus applies their clauses collectively. If several
- 217,COLUMN,
- COLUMN commands apply the same clause to the same column, the last one
- 218,COLUMN,
- entered will control the output.
- 219,COLUMN,
-
- 220,COLUMN,
- Examples: To make the ENAME column 20 characters wide and display EMPLOYEE
- 221,COLUMN,
- NAME on two lines at the top, enter:
- 222,COLUMN,
-
- 223,COLUMN,
- SQL> COLUMN ENAME FORMAT A20 HEADING 'EMPLOYEE |NAME'
- 224,COLUMN,
-
- 225,COLUMN,
-
- 226,COLUMN,
- To format the SAL column so that it shows millions of dollars,
- 227,COLUMN,
- rounds to cents, uses commas to separate thousands, and displays
- 228,COLUMN,
- $0.00 when a value is zero:
- 229,COLUMN,
-
- 230,COLUMN,
- SQL> COLUMN SAL FORMAT $9,999,990.99
- 231,COLUMN,
-
- 232,COLUMN,
-
- 233,COLUMN,
- To assign the alias NET to a column with a long expression,
- 234,COLUMN,
- display the result in a dollar format, and display <NULL> for
- 235,COLUMN,
- null values, enter:
- 236,COLUMN,
-
- 237,COLUMN,
- SQL> COLUMN SAL+COMM+BONUS-EXPENSES-INS-TAX ALIAS NET
- 238,COLUMN,
- SQL> COLUMN NET FORMAT $9,999,999.99 NULL '<NULL>'
- 239,COLUMN,
-
- 240,COLUMN,
-
- 241,COLUMN,
- This column specification is divided into two commands. The
- 242,COLUMN,
- first defines the alias NET, and the second uses NET to define
- 243,COLUMN,
- the format. In the first command, you must enter the expression
- 244,COLUMN,
- exactly as in the SELECT statement. Otherwise, SQL*Plus cannot
- 245,COLUMN,
- match the COLUMN command to the appropriate column. To wrap
- 246,COLUMN,
- long values in a column named REMARKS, enter:
- 247,COLUMN,
-
- 248,COLUMN,
- SQL> COLUMN REMARKS FORMAT A20 WRAP
- 249,COLUMN,
-
- 250,COLUMN,
- Output:
- 251,COLUMN,
-
- 252,COLUMN,
- CUSTOMER DATE QUANTITY REMARKS
- 253,COLUMN,
- -------- --------- -------- --------------------
- 254,COLUMN,
- 123 25-AUG-89 144 This order must be s
- 255,COLUMN,
- hipped by air freigh
- 256,COLUMN,
- t to ORD.
- 257,COLUMN,
-
- 258,COLUMN,
- If you replace WRAP with WORD_WRAP:
- 259,COLUMN,
-
- 260,COLUMN,
- CUSTOMER DATE QUANTITY REMARKS
- 261,COLUMN,
- -------- --------- -------- --------------------
- 262,COLUMN,
- 123 25-AUG-89 144 This order must be
- 263,COLUMN,
- shipped by air
- 264,COLUMN,
- freight to ORD.
- 265,COLUMN,
-
- 266,COLUMN,
- If you specify TRUNCATE instead of WORD_WRAP:
- 267,COLUMN,
-
- 268,COLUMN,
- CUSTOMER DATE QUANTITY REMARKS
- 269,COLUMN,
- -------- --------- -------- --------------------
- 270,COLUMN,
- 123 25-AUG-89 144 This order must be s
- 271,COLUMN,
-
- 272,COLUMN,
-
- 273,COLUMN,
- To print the current date and the name of each job in the top
- 274,COLUMN,
- title:
- 275,COLUMN,
-
- 276,COLUMN,
- SQL> COLUMN JOB NOPRINT NEW_VALUE JOBVAR
- 277,COLUMN,
- SQL> COLUMN TODAY NOPRINT NEW_VALUE DATEVAR
- 278,COLUMN,
- SQL> BREAK ON JOB SKIP PAGE
- 279,COLUMN,
- SQL> TTITLE CENTER 'Job Report' RIGHT DATEVAR SKIP 2 -
- 280,COLUMN,
- > LEFT 'Job: ' JOBVAR SKIP 2
- 281,COLUMN,
- SQL> SELECT TO_CHAR(SYSDATE, 'MM/DD/YY') TODAY,
- 282,COLUMN,
- 2 ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO
- 283,COLUMN,
- 3 FROM EMP WHERE JOB IN ('CLERK', 'SALESMAN')
- 284,COLUMN,
- 4 ORDER BY JOB, ENAME;
- 285,COLUMN,
-
- 286,COLUMN,
- Your 2-page report would look like this, with "Job Report"
- 287,COLUMN,
- centered in your current line size:
- 288,COLUMN,
-
- 289,COLUMN,
- Job Report 05/01/89
- 290,COLUMN,
-
- 291,COLUMN,
- Job: CLERK
- 292,COLUMN,
-
- 293,COLUMN,
- ENAME MGR HIREDATE SAL DEPTNO
- 294,COLUMN,
- ---------- --------- --------- ----------- ----------
- 295,COLUMN,
- ADAMS 7788 14-JAN-87 1100 20
- 296,COLUMN,
- JAMES 7698 03-DEC-88 950 30
- 297,COLUMN,
- MILLER 7782 23-JAN-89 1300 10
- 298,COLUMN,
- SMITH 7902 17-DEC-88 800 20
- 299,COLUMN,
-
- 300,COLUMN,
- Job Report 05/01/89
- 301,COLUMN,
-
- 302,COLUMN,
- Job: SALESMAN
- 303,COLUMN,
-
- 304,COLUMN,
- ENAME MGR HIREDATE SAL DEPTNO
- 305,COLUMN,
- ---------- --------- --------- ----------- ----------
- 306,COLUMN,
- ALLEN 7698 20-FEB-88 1600 30
- 307,COLUMN,
- MARTIN 7698 28-SEP-86 1250 30
- 308,COLUMN,
- TURNER 7698 08-SEP-83 1500 30
- 309,COLUMN,
- WARD 7698 22-FEB-89 1250 30
- 310,COLUMN,
-
- 311,COLUMN,
-
- 312,COLUMN,
- See also: break, compute, clear, order by set (long, numwidth, wrap),
- 313,COLUMN,
- ttitle, commands, menu.
- 1,COMMENT,
-
- 2,COMMENT,
-
- 3,COMMENT,
- COMMENT
- 4,COMMENT,
- SQL statement
- 5,COMMENT,
- COMMENT ON TABLE user.table
- 6,COMMENT,
- IS 'text'
- 7,COMMENT,
-
- 8,COMMENT,
- COMMENT ON COLUMN user.table.column
- 9,COMMENT,
- IS 'text'
- 10,COMMENT,
-
- 11,COMMENT,
- Use COMMENT to insert a comment about a table or column into the data
- 12,COMMENT,
- dictionary. To see the comment, select the REMARKS column from the data
- 13,COMMENT,
- dictionary view ALL_COL_COMMENTS, ALL_TAB_COMMENTS, USER_COL_COMMENTS, or
- 14,COMMENT,
- USER_TAB_COMMENTS.
- 15,COMMENT,
-
- 16,COMMENT,
- To drop a comment from the database, use two apostrophes (an empty string)
- 17,COMMENT,
- after IS.
- 18,COMMENT,
-
- 19,COMMENT,
-
- 20,COMMENT,
-
- 21,COMMENT,
- See also: comments (in sql statements), data dictionary, commands, menu.
- 1,COMMIT,
-
- 2,COMMIT,
-
- 3,COMMIT,
- COMMIT
- 4,COMMIT,
- SQL statement
- 5,COMMIT,
- COMMIT;
- 6,COMMIT,
- COMMIT WORK;
- 7,COMMIT,
-
- 8,COMMIT,
- The COMMIT statement makes permanent any database changes made since
- 9,COMMIT,
- the last COMMIT, and reveals the changes to other users.
- 10,COMMIT,
-
- 11,COMMIT,
- All row and table locks are released. All savepoints declared since
- 12,COMMIT,
- the last COMMIT or ROLLBACK are erased.
- 13,COMMIT,
-
- 14,COMMIT,
- Until you COMMIT changes, you can use the ROLLBACK statement to undo
- 15,COMMIT,
- them. All changes since your last commit are erased; the database is
- 16,COMMIT,
- the way it was just after the last COMMIT.
- 17,COMMIT,
-
- 18,COMMIT,
- Use COMMIT WORK for ANSI compatibility.
- 19,COMMIT,
-
- 20,COMMIT,
-
- 21,COMMIT,
-
- 22,COMMIT,
- See also: example, rollback, savepoint, transactions, set transaction,
- 23,COMMIT,
- bnf syntax, commands, menu.
- 1,COMPUTE,
-
- 2,COMPUTE,
-
- 3,COMPUTE,
- COMPUTE
- 4,COMPUTE,
-
- 5,COMPUTE,
- COMP[UTE] [function ...
- 6,COMPUTE,
- OF { quoted_select_expr | column | alias}...
- 7,COMPUTE,
- ON { quoted_select_expr | column | alias | REPORT| ROW}]
- 8,COMPUTE,
-
- 9,COMPUTE,
- COMPUTE calculates and prints summary lines, using various standard
- 10,COMPUTE,
- computations, on subsets of selected rows. It also lists all COMPUTE
- 11,COMPUTE,
- definitions.
- 12,COMPUTE,
-
- 13,COMPUTE,
- Function Computes
- 14,COMPUTE,
- --------------------------------------------------
- 15,COMPUTE,
- AVG Average of non-null values
- 16,COMPUTE,
- COU[NT] Count of non-null values
- 17,COMPUTE,
- MAX[IMUM] Maximum value
- 18,COMPUTE,
- MIN[IMUM] Minimum value
- 19,COMPUTE,
- NUM[BER] Count of rows
- 20,COMPUTE,
- STD Standard deviation of non-null values
- 21,COMPUTE,
- SUM Sum of non-null values
- 22,COMPUTE,
- VAR[IANCE] Variance of non-null values
- 23,COMPUTE,
-
- 24,COMPUTE,
- If you specify more than one function, use spaces between them.
- 25,COMPUTE,
-
- 26,COMPUTE,
- OF { quoted_select_expr | column | alias }...
- 27,COMPUTE,
- specifies the column(s) or expression(s) to be used in the
- 28,COMPUTE,
- computation. You must also specify these columns in the SELECT
- 29,COMPUTE,
- statement, or SQL*Plus will ignore the COMPUTE command.
- 30,COMPUTE,
-
- 31,COMPUTE,
- If you don't want the computed values of a given column to appear
- 32,COMPUTE,
- in the output of a SELECT statement, use the COLUMN command with
- 33,COMPUTE,
- a NOPRINT clause. Use spaces between multiple expressions,
- 34,COMPUTE,
- columns, or aliases within the OF clause.
- 35,COMPUTE,
-
- 36,COMPUTE,
- To reference a SELECT expression or function reference in an OF
- 37,COMPUTE,
- clause, place the expression or function reference in "quotes".
- 38,COMPUTE,
- Column names and aliases do not need quotes.
- 39,COMPUTE,
-
- 40,COMPUTE,
- ON { quoted_select_expr | column | alias | REPORT | ROW }]
- 41,COMPUTE,
- specifies the event SQL*Plus will use as a break. COMPUTE prints
- 42,COMPUTE,
- the computed value and restarts the computation when the event
- 43,COMPUTE,
- occurs (i.e., when the value of the expression changes, a new ROW
- 44,COMPUTE,
- is fetched, or the end of the report is reached).
- 45,COMPUTE,
-
- 46,COMPUTE,
- If multiple COMPUTE commands reference the same column in the ON
- 47,COMPUTE,
- clause, only the last COMPUTE command applies.
- 48,COMPUTE,
-
- 49,COMPUTE,
- To reference a SQL SELECT expression or function reference in
- 50,COMPUTE,
- an ON clause, put the expression or function reference in quotes.
- 51,COMPUTE,
- Column names and aliases do not need quotes. Enter COMPUTE
- 52,COMPUTE,
- without clauses to list all COMPUTE definitions.
- 53,COMPUTE,
-
- 54,COMPUTE,
-
- 55,COMPUTE,
- For SQL*Plus to perform the computations:
- 56,COMPUTE,
-
- 57,COMPUTE,
- - The expression, column, or column alias referenced in the ON clause
- 58,COMPUTE,
- must be in the SELECT statement.
- 59,COMPUTE,
-
- 60,COMPUTE,
- - The expression, column, or column alias referenced in the ON clause
- 61,COMPUTE,
- must also be in the most recent BREAK command.
- 62,COMPUTE,
-
- 63,COMPUTE,
- - If you reference either ROW or REPORT in the ON clause, you must
- 64,COMPUTE,
- also reference ROW or REPORT in the most recent BREAK command.
- 65,COMPUTE,
-
- 66,COMPUTE,
- - One or more of the expressions, columns, or column aliases
- 67,COMPUTE,
- referenced in the OF clause must also be in the SELECT statement.
- 68,COMPUTE,
-
- 69,COMPUTE,
-
- 70,COMPUTE,
- Examples: To subtotal the salary for the clerk, analyst, and salesman
- 71,COMPUTE,
- jobs, enter:
- 72,COMPUTE,
-
- 73,COMPUTE,
- SQL> BREAK ON JOB SKIP 1
- 74,COMPUTE,
- SQL> COMPUTE SUM OF SAL ON JOB
- 75,COMPUTE,
- SQL> SELECT JOB, ENAME, SAL
- 76,COMPUTE,
- 2 FROM EMP
- 77,COMPUTE,
- 3 WHERE JOB IN ('CLERK', 'ANALYST', 'SALESMAN')
- 78,COMPUTE,
- 4 ORDER BY JOB, SAL;
- 79,COMPUTE,
-
- 80,COMPUTE,
- Output:
- 81,COMPUTE,
-
- 82,COMPUTE,
- JOB ENAME SAL
- 83,COMPUTE,
- --------- ---------- ----------
- 84,COMPUTE,
- ANALYST SCOTT 3000
- 85,COMPUTE,
- FORD 3000
- 86,COMPUTE,
- ********* ----------
- 87,COMPUTE,
- sum 6000
- 88,COMPUTE,
-
- 89,COMPUTE,
- CLERK SMITH 800
- 90,COMPUTE,
- JAMES 950
- 91,COMPUTE,
- ADAMS 1100
- 92,COMPUTE,
- MILLER 1300
- 93,COMPUTE,
- ********* ----------
- 94,COMPUTE,
- sum 4150
- 95,COMPUTE,
-
- 96,COMPUTE,
- SALESMAN WARD 1250
- 97,COMPUTE,
- MARTIN 1250
- 98,COMPUTE,
- TURNER 1500
- 99,COMPUTE,
- ALLEN 1600
- 100,COMPUTE,
- WILSON 3000
- 101,COMPUTE,
- ********* ----------
- 102,COMPUTE,
- sum 8600
- 103,COMPUTE,
-
- 104,COMPUTE,
-
- 105,COMPUTE,
- To compute the average and maximum salary for the accounting and
- 106,COMPUTE,
- sales departments, enter:
- 107,COMPUTE,
-
- 108,COMPUTE,
-
- 109,COMPUTE,
- SQL> BREAK ON DNAME SKIP 1
- 110,COMPUTE,
- SQL> COMPUTE AVG MAX OF SAL ON DNAME
- 111,COMPUTE,
- SQL> SELECT DNAME, ENAME, SAL
- 112,COMPUTE,
- 2 FROM DEPT, EMP
- 113,COMPUTE,
- 3 WHERE DEPT.DEPTNO=EMP.DEPTNO
- 114,COMPUTE,
- 4 AND DNAME IN ('ACCOUNTING', 'SALES')
- 115,COMPUTE,
- 5 ORDER BY DNAME;
- 116,COMPUTE,
-
- 117,COMPUTE,
- Output:
- 118,COMPUTE,
-
- 119,COMPUTE,
- DNAME ENAME SAL
- 120,COMPUTE,
- -------------- ---------- ----------
- 121,COMPUTE,
- ACCOUNTING CLARK 2450
- 122,COMPUTE,
- KING 5000
- 123,COMPUTE,
- MILLER 1300
- 124,COMPUTE,
- ************** ----------
- 125,COMPUTE,
- avg 2916.66667
- 126,COMPUTE,
- maximum 5000
- 127,COMPUTE,
-
- 128,COMPUTE,
- SALES ALLEN 1600
- 129,COMPUTE,
- WARD 1250
- 130,COMPUTE,
- MARTIN 1250
- 131,COMPUTE,
- TURNER 1500
- 132,COMPUTE,
- JAMES 950
- 133,COMPUTE,
- BLAKE 2850
- 134,COMPUTE,
- ************** ----------
- 135,COMPUTE,
- avg 1566.66667
- 136,COMPUTE,
- maximum 2850
- 137,COMPUTE,
-
- 138,COMPUTE,
-
- 139,COMPUTE,
- See also: column, break, select, commands, menu.
- 1,CONNECT,
-
- 2,CONNECT,
-
- 3,CONNECT,
- CONNECT
- 4,CONNECT,
-
- 5,CONNECT,
- CONN[ECT] username [ /password ] [ @database_specification ] | /
- 6,CONNECT,
-
- 7,CONNECT,
- CONNECT establishes a connection to an ORACLE database.
- 8,CONNECT,
-
- 9,CONNECT,
- username [/password]
- 10,CONNECT,
- are the username and password connecting to ORACLE. If you omit
- 11,CONNECT,
- the username or password, SQL*Plus prompts you for them. If you
- 12,CONNECT,
- enter a slash (/) or enter RETURN to the prompt for username,
- 13,CONNECT,
- SQL*Plus logs you on with a default logon.
- 14,CONNECT,
-
- 15,CONNECT,
- @database_specification
- 16,CONNECT,
- is a SQL*Net connection string. The syntax depends on the SQL*Net
- 17,CONNECT,
- communications protocol of your ORACLE installation. SQL*Plus
- 18,CONNECT,
- does not prompt you for a database_specification, but uses your
- 19,CONNECT,
- default database if you omit a specification.
- 20,CONNECT,
-
- 21,CONNECT,
- / is a default (ops$) logon. You can't use a database_specification
- 22,CONNECT,
- if you use a default logon. In a default logon, SQL*Plus tries to
- 23,CONNECT,
- log on with OPS$ name; name is the operating system username.
- 24,CONNECT,
-
- 25,CONNECT,
- CONNECT commits the current transaction to the database, disconnects the
- 26,CONNECT,
- current username from ORACLE, and reconnects with the specified username.
- 27,CONNECT,
-
- 28,CONNECT,
-
- 29,CONNECT,
- Examples: To connect with username SCOTT and password TIGER to the default
- 30,CONNECT,
- database on the DECnet node "corp", enter:
- 31,CONNECT,
-
- 32,CONNECT,
- SQL> CONNECT SCOTT/TIGER@d:corp
- 33,CONNECT,
-
- 34,CONNECT,
- To connect with username SCOTT and let SQL*Plus prompt you for
- 35,CONNECT,
- the password, enter:
- 36,CONNECT,
-
- 37,CONNECT,
- SQL> CONNECT SCOTT
- 38,CONNECT,
-
- 39,CONNECT,
-
- 40,CONNECT,
- See also: disconnect, exit, host, quit, commands, menu.
- 1,CONNECT BY,
-
- 2,CONNECT BY,
-
- 3,CONNECT BY,
- CONNECT BY
- 4,CONNECT BY,
- SQL clauses
- 5,CONNECT BY,
- SELECT list FROM...
- 6,CONNECT BY,
- WHERE...
- 7,CONNECT BY,
- CONNECT BY PRIOR expr1 operator expr2 --displays expr1 first
- 8,CONNECT BY,
- CONNECT BY expr1 operator PRIOR expr2 --displays expr2 first
- 9,CONNECT BY,
- START WITH condition; --not required
- 10,CONNECT BY,
-
- 11,CONNECT BY,
- The CONNECT BY clause connects rows in a tree-structured hierarchy,
- 12,CONNECT BY,
- defined by PRIOR. Put PRIOR in front of the parent expression:
- 13,CONNECT BY,
-
- 14,CONNECT BY,
- CONNECT BY PRIOR EMPNO = MGR
- 15,CONNECT BY,
-
- 16,CONNECT BY,
- CONNECT BY cannot be used in subquery or join operations.
- 17,CONNECT BY,
-
- 18,CONNECT BY,
-
- 19,CONNECT BY,
- See also: example connect by, conditions, tree-structured query,
- 20,CONNECT BY,
- start with, where, commands, menu.
- 1,COPY,
-
- 2,COPY,
-
- 3,COPY,
- COPY
- 4,COPY,
-
- 5,COPY,
- COPY [FROM username [ /password ] [ @database_specification ] |
- 6,COPY,
- TO username [ /password ] [ @database_specification ] ]
- 7,COPY,
- {APPEND|CREATE|INSERT|REPLACE} destination_table
- 8,COPY,
- [(column, column, column ...)] USING query
- 9,COPY,
-
- 10,COPY,
- COPY copies data from a query to a table in a local or remote database.
- 11,COPY,
-
- 12,COPY,
- username [ /password ]
- 13,COPY,
- are the ORACLE username/password you wish to COPY FROM and TO.
- 14,COPY,
- In the FROM clause, username/password identifies the data source;
- 15,COPY,
- in the TO clause, username/password identifies the destination.
- 16,COPY,
- If you do not specify password in either the FROM or TO clause,
- 17,COPY,
- SQL*Plus prompts you for it.
- 18,COPY,
-
- 19,COPY,
- @database_specification
- 20,COPY,
- is a database link name or a SQL*Net connection string. In the
- 21,COPY,
- FROM clause, database_specification is the database at the source;
- 22,COPY,
- in the TO clause, database_specification is the database at the
- 23,COPY,
- destination. The syntax depends upon the SQL*Net communications
- 24,COPY,
- protocol of your ORACLE installation. SQL*Plus does not prompt
- 25,COPY,
- you for a database specification, but uses your default database
- 26,COPY,
- if you omit a specification.
- 27,COPY,
-
- 28,COPY,
- destination_table
- 29,COPY,
- is the table to be created or to which you wish to add data.
- 30,COPY,
-
- 31,COPY,
- (column, column, column, ... )
- 32,COPY,
- specifies the names of the columns in destination_table. You must
- 33,COPY,
- enclose a name in "double quotes" if it contains lowercase letters
- 34,COPY,
- or spaces. The number of columns you specify must equal the
- 35,COPY,
- number of columns selected by the query. If you don't specify any
- 36,COPY,
- columns, they will have the same names in the destination table as
- 37,COPY,
- they had in the source, if COPY creates destination_table.
- 38,COPY,
-
- 39,COPY,
- USING query
- 40,COPY,
- specifies a SQL query (SELECT statement) to determine which rows
- 41,COPY,
- and columns to copy.
- 42,COPY,
-
- 43,COPY,
- FROM username [ /password ] [ @database_specification ]
- 44,COPY,
- specifies the username, password, and database with the data to be
- 45,COPY,
- copied. If the FROM clause is omitted, the source defaults to the
- 46,COPY,
- database SQL*Plus is connected to. You must include this clause
- 47,COPY,
- to specify a source database other than the default.
- 48,COPY,
-
- 49,COPY,
- TO username [ /password ] [ @database_specification ]
- 50,COPY,
- specifies the database containing the destination table. If you
- 51,COPY,
- omit the TO clause, the destination defaults to the database
- 52,COPY,
- SQL*Plus is connected to. You must include this clause to specify
- 53,COPY,
- a destination database other than the default.
- 54,COPY,
-
- 55,COPY,
- APPEND
- 56,COPY,
- inserts the rows from query into destination_table if the table
- 57,COPY,
- exists. If destination_table does not exist, COPY creates it.
- 58,COPY,
-
- 59,COPY,
- CREATE
- 60,COPY,
- inserts the rows from query into destination_table after creating
- 61,COPY,
- the table. If destination_table exists, COPY returns an error.
- 62,COPY,
-
- 63,COPY,
- INSERT
- 64,COPY,
- inserts the rows from query into destination_table if the table
- 65,COPY,
- exists. If destination_table doesn't exist, COPY returns an error.
- 66,COPY,
-
- 67,COPY,
- REPLACE
- 68,COPY,
- deletes existing rows from destination_table, and inserts the rows
- 69,COPY,
- from query into destination_table, if the table exists. If the
- 70,COPY,
- table does not exist, COPY creates it.
- 71,COPY,
-
- 72,COPY,
-
- 73,COPY,
- The SQL*Plus SET system_variable LONG clause limits the length of LONG
- 74,COPY,
- columns that are copied. If any LONG columns have data longer than the
- 75,COPY,
- LONG value, COPY truncates the data. SQL*Plus performs a commit at the
- 76,COPY,
- end of each successful COPY. If you set the SQL*Plus SET system_variable
- 77,COPY,
- COPYCOMMIT to a positive value n, SQL*Plus performs a commit after copying
- 78,COPY,
- every n batches of records; the SET system_variable ARRAYSIZE clause
- 79,COPY,
- determines the size of the batch.
- 80,COPY,
-
- 81,COPY,
-
- 82,COPY,
- Examples: The command below copies the entire EMP table from database HQ
- 83,COPY,
- to a table named WESTEMP in database WEST. If WESTEMP already
- 84,COPY,
- exists, SQL*Plus replaces its contents. Columns in WESTEMP have
- 85,COPY,
- the same names as the columns in the source table, EMP:
- 86,COPY,
-
- 87,COPY,
- SQL> COPY FROM SCOTT/TIGER@HQ TO JOHN/CHROME@WEST -
- 88,COPY,
- > REPLACE WESTEMP -
- 89,COPY,
- > USING SELECT * FROM EMP
- 90,COPY,
-
- 91,COPY,
-
- 92,COPY,
- The following command copies selected records from EMP in
- 93,COPY,
- database HQ to the database to which SQL*Plus is connected:
- 94,COPY,
- SQL*Plus creates SALESMEN through the copy. SQL*Plus copies
- 95,COPY,
- only the columns EMPNO and ENAME and at the destination names
- 96,COPY,
- them EMPNO and SALESMAN.
- 97,COPY,
-
- 98,COPY,
- SQL> COPY FROM SCOTT/TIGER@HQ -
- 99,COPY,
- > CREATE SALESMEN (EMPNO,SALESMAN) -
- 100,COPY,
- > USING SELECT EMPNO, ENAME FROM EMP -
- 101,COPY,
- > WHERE JOB='SALES'
- 102,COPY,
-
- 103,COPY,
-
- 104,COPY,
- SQL*Plus creates SALESMEN through the copy, copies columns EMPNO
- 105,COPY,
- and ENAME, and names them EMPNO and SALESMAN at the destination.
- 106,COPY,
-
- 107,COPY,
-
- 108,COPY,
- See also: connect, disconnect, describe, edit, set (arraysize, copycommit,
- 109,COPY,
- long), commands, menu.
- 1,CREATE CLUSTER,
-
- 2,CREATE CLUSTER,
-
- 3,CREATE CLUSTER,
- CREATE CLUSTER
- 4,CREATE CLUSTER,
- SQL statement
- 5,CREATE CLUSTER,
- CREATE CLUSTER user.cluster
- 6,CREATE CLUSTER,
- column datatype, column datatype,...
- 7,CREATE CLUSTER,
- PCTUSED integer PCTFREE integer
- 8,CREATE CLUSTER,
- SIZE integer
- 9,CREATE CLUSTER,
- INITRANS integer MAXTRANS integer
- 10,CREATE CLUSTER,
- TABLESPACE tablespace
- 11,CREATE CLUSTER,
- STORAGE storage
- 12,CREATE CLUSTER,
-
- 13,CREATE CLUSTER,
- Creates a cluster that may contain one or more tables. Clustering forces
- 14,CREATE CLUSTER,
- rows of one or more tables with the same cluster key to be stored together
- 15,CREATE CLUSTER,
- in the database. Access time to rows with the same cluster key is faster.
- 16,CREATE CLUSTER,
- Generally, it's good to cluster tables that are often joined together.
- 17,CREATE CLUSTER,
-
- 18,CREATE CLUSTER,
- Column is the name of one or more columns that are the cluster key. The
- 19,CREATE CLUSTER,
- datatype cannot be NULL or NOT NULL. SIZE specifies the average space
- 20,CREATE CLUSTER,
- required to store all rows with the same cluster key value.
- 21,CREATE CLUSTER,
-
- 22,CREATE CLUSTER,
- CREATE TABLE describes PCTUSED, PCTFREE, INITRANS, and MAXTRANS integers.
- 23,CREATE CLUSTER,
-
- 24,CREATE CLUSTER,
- See also: create index, create table, commands, menu.
- 1,CREATE DATABASE,
-
- 2,CREATE DATABASE,
-
- 3,CREATE DATABASE,
- CREATE DATABASE
- 4,CREATE DATABASE,
- SQL statement
- 5,CREATE DATABASE,
- CREATE DATABASE database
- 6,CREATE DATABASE,
- CONTROLFILE REUSE WARNING: If the specified
- 7,CREATE DATABASE,
- LOGFILE filespec, filespec,... database currently exists,
- 8,CREATE DATABASE,
- MAXLOGFILES integer using CREATE DATABASE will
- 9,CREATE DATABASE,
- DATAFILE filespec, filespec,... destroy any data within it.
- 10,CREATE DATABASE,
- MAXDATAFILES integer
- 11,CREATE DATABASE,
- MAXINSTANCES integer
- 12,CREATE DATABASE,
- ARCHIVELOG | NOARCHIVELOG --default is NOARCHIVELOG
- 13,CREATE DATABASE,
- SHARED | EXCLUSIVE --default is SHARED
- 14,CREATE DATABASE,
-
- 15,CREATE DATABASE,
- CREATE DATABASE prepares a database for initial use.
- 16,CREATE DATABASE,
-
- 17,CREATE DATABASE,
- database
- 18,CREATE DATABASE,
- is a database name, up to 8 characters. If omitted, the database
- 19,CREATE DATABASE,
- name is the one specified by the INIT.ORA parameter DB_NAME.
- 20,CREATE DATABASE,
-
- 21,CREATE DATABASE,
- CONTROLFILE REUSE
- 22,CREATE DATABASE,
- reuses files specified by the INIT.ORA parameter CONTROL_FILES,
- 23,CREATE DATABASE,
- erasing any data they may currently hold. Ususlly omitted the
- 24,CREATE DATABASE,
- first time a database is created.
- 25,CREATE DATABASE,
-
- 26,CREATE DATABASE,
- LOGFILE filespec
- 27,CREATE DATABASE,
- specifies one or more files as redo log files; if omitted, ORACLE
- 28,CREATE DATABASE,
- creates two default log files with names and sizes that depend on
- 29,CREATE DATABASE,
- the operating system.
- 30,CREATE DATABASE,
-
- 31,CREATE DATABASE,
- MAXLOGFILES integer
- 32,CREATE DATABASE,
- sets the maximum number of redo log files that can be created for
- 33,CREATE DATABASE,
- the database; the range is 2 - 256. The number can be increased
- 34,CREATE DATABASE,
- only by recreating the database. The overhead incurred by a large
- 35,CREATE DATABASE,
- number is negligible.
- 36,CREATE DATABASE,
-
- 37,CREATE DATABASE,
- filespec
- 38,CREATE DATABASE,
- specifies a file, written 'filename' SIZE integer K | M REUSE.
- 39,CREATE DATABASE,
- Integer specifies the SIZE in bytes; K = integer x 1024 bytes;
- 40,CREATE DATABASE,
- M = integer x 1,048,576 bytes. If integer is omitted, ORACLE
- 41,CREATE DATABASE,
- uses a default of 10M for database files and 500K for log files.
- 42,CREATE DATABASE,
-
- 43,CREATE DATABASE,
- DATAFILE filespec
- 44,CREATE DATABASE,
- specifies one or more files as database files; if omitted, ORACLE
- 45,CREATE DATABASE,
- creates one file with a name that depends on the operating system.
- 46,CREATE DATABASE,
-
- 47,CREATE DATABASE,
- MAXDATAFILES integer
- 48,CREATE DATABASE,
- sets the maximum number of database files that can be created for
- 49,CREATE DATABASE,
- the database; the range is typically 1 - 255. The number can't be
- 50,CREATE DATABASE,
- increased without recreating the database. The overhead incurred
- 51,CREATE DATABASE,
- by a large number is negligible.
- 52,CREATE DATABASE,
-
- 53,CREATE DATABASE,
- MAXINSTANCES integer
- 54,CREATE DATABASE,
- sets the maximum number of instances which can mount and open the
- 55,CREATE DATABASE,
- database at the same time; the range is 1 - 255.
- 56,CREATE DATABASE,
-
- 57,CREATE DATABASE,
- ARCHIVELOG or NOARCHIVELOG
- 58,CREATE DATABASE,
- specifies the initial mode of redo log files use. ARCHIVELOG sets
- 59,CREATE DATABASE,
- log files to be archived before they are reused, NOARCHIVELOG does
- 60,CREATE DATABASE,
- not; NOARCHIVELOG is the default. ALTER DATABASE changes the mode.
- 61,CREATE DATABASE,
-
- 62,CREATE DATABASE,
- SHARED or EXCLUSIVE
- 63,CREATE DATABASE,
- sets the availability of the database at the end of creation. If
- 64,CREATE DATABASE,
- SHARED, multiple instances can access the database; if EXCLUSIVE,
- 65,CREATE DATABASE,
- only one instance can access it. After creation, use the SQL*DBA
- 66,CREATE DATABASE,
- command STARTUP to set access to the database.
- 67,CREATE DATABASE,
-
- 68,CREATE DATABASE,
-
- 69,CREATE DATABASE,
- See also: alter database, create rollback, create tablespace, commands.
- 1,CREATE DB LINK,
-
- 2,CREATE DB LINK,
-
- 3,CREATE DB LINK,
- CREATE DB LINK
- 4,CREATE DB LINK,
- SQL statement
- 5,CREATE DB LINK,
- CREATE PUBLIC DATABASE LINK linkname
- 6,CREATE DB LINK,
- CONNECT TO username IDENTIFIED BY password
- 7,CREATE DB LINK,
- USING 'sql*net_string'
- 8,CREATE DB LINK,
-
- 9,CREATE DB LINK,
- CREATE DATABASE LINK sets up a link from the local database to a username
- 10,CREATE DB LINK,
- on a remote database. To query a remote table, add @linkname after its
- 11,CREATE DB LINK,
- name in the FROM clause of a SELECT statement.
- 12,CREATE DB LINK,
-
- 13,CREATE DB LINK,
- PUBLIC
- 14,CREATE DB LINK,
- makes the link available to all users except those who've defined
- 15,CREATE DB LINK,
- a private database link with the same name. If PUBLIC is omitted,
- 16,CREATE DB LINK,
- the link is private--available only to its creator.
- 17,CREATE DB LINK,
-
- 18,CREATE DB LINK,
- username, password
- 19,CREATE DB LINK,
- must exist on the remote database. If omitted, the database link
- 20,CREATE DB LINK,
- will use the current username and password when invoked.
- 21,CREATE DB LINK,
-
- 22,CREATE DB LINK,
- 'sql*net_string'
- 23,CREATE DB LINK,
- specifies a remote database accessible through SQL*Net.
- 24,CREATE DB LINK,
-
- 25,CREATE DB LINK,
- See also: distributed query, select, from, create synonym, commands, menu.
- 1,CREATE INDEX,
-
- 2,CREATE INDEX,
-
- 3,CREATE INDEX,
- CREATE INDEX
- 4,CREATE INDEX,
- SQL statement
- 5,CREATE INDEX,
- CREATE UNIQUE INDEX index ON table (column ASC|DESC, column ASC|DESC,...)
- 6,CREATE INDEX,
- | CLUSTER cluster
- 7,CREATE INDEX,
- INITRANS integer MAXTRANS integer
- 8,CREATE INDEX,
- TABLESPACE tablespace
- 9,CREATE INDEX,
- STORAGE storage
- 10,CREATE INDEX,
- PCTFREE = 10 | n
- 11,CREATE INDEX,
- NOSORT
- 12,CREATE INDEX,
-
- 13,CREATE INDEX,
- CREATE INDEX creates an index for a table or a cluster index. An index
- 14,CREATE INDEX,
- reduces access time by giving direct access to rows in a table; you can
- 15,CREATE INDEX,
- also use an index to enforce uniqueness. An index may contain up to 16
- 16,CREATE INDEX,
- columns. You may create multiple indexes on combinations of columns in
- 17,CREATE INDEX,
- the same table, but each index increases processing time during updates.
- 18,CREATE INDEX,
-
- 19,CREATE INDEX,
- UNIQUE
- 20,CREATE INDEX,
- ensures that the table never has two rows with identical values
- 21,CREATE INDEX,
- in all index columns.
- 22,CREATE INDEX,
-
- 23,CREATE INDEX,
- index, table
- 24,CREATE INDEX,
- are the names of the index and the table for which the index is
- 25,CREATE INDEX,
- being created.
- 26,CREATE INDEX,
-
- 27,CREATE INDEX,
- column
- 28,CREATE INDEX,
- is the name of a column in the table.
- 29,CREATE INDEX,
-
- 30,CREATE INDEX,
- ASC or DESC
- 31,CREATE INDEX,
- are for DB2 compatibility. Indexes are created in ascending order.
- 32,CREATE INDEX,
-
- 33,CREATE INDEX,
- cluster
- 34,CREATE INDEX,
- is the name of a cluster for which the index is being created.
- 35,CREATE INDEX,
-
- 36,CREATE INDEX,
- tablespace
- 37,CREATE INDEX,
- is the name of the tablespace that will hold the index.
- 38,CREATE INDEX,
-
- 39,CREATE INDEX,
- PCTFREE
- 40,CREATE INDEX,
- sets the percentage of space in each index block to leave free for
- 41,CREATE INDEX,
- updates and insertions.
- 42,CREATE INDEX,
-
- 43,CREATE INDEX,
- NOSORT
- 44,CREATE INDEX,
- prevents ORACLE from sorting the rows when generating the index,
- 45,CREATE INDEX,
- because the rows are already stored in ascending order. NOSORT
- 46,CREATE INDEX,
- can greatly reduce the time required to create an index. NOSORT
- 47,CREATE INDEX,
- cannot be used when creating a cluster index.
- 48,CREATE INDEX,
-
- 49,CREATE INDEX,
-
- 50,CREATE INDEX,
- See CREATE TABLE for descriptions of INITRANS and MAXTRANS; see STORAGE
- 51,CREATE INDEX,
- for the syntax of the STORAGE clause.
- 52,CREATE INDEX,
-
- 53,CREATE INDEX,
-
- 54,CREATE INDEX,
- See also: alter index, drop index, validate index, commands, menu.
- 1,CREATE ROLLBACK SEGMENT,
-
- 2,CREATE ROLLBACK SEGMENT,
-
- 3,CREATE ROLLBACK SEGMENT,
- CREATE ROLLBACK SEGMENT
- 4,CREATE ROLLBACK SEGMENT,
- SQL statement
- 5,CREATE ROLLBACK SEGMENT,
- CREATE PUBLIC ROLLBACK SEGMENT rollback_segment_name
- 6,CREATE ROLLBACK SEGMENT,
- TABLESPACE tablespace
- 7,CREATE ROLLBACK SEGMENT,
- STORAGE storage
- 8,CREATE ROLLBACK SEGMENT,
-
- 9,CREATE ROLLBACK SEGMENT,
- CREATE ROLLBACK SEGMENT creates a rollback segment. The tablespace must
- 10,CREATE ROLLBACK SEGMENT,
- be on-line when a rollback segment is added to it.
- 11,CREATE ROLLBACK SEGMENT,
-
- 12,CREATE ROLLBACK SEGMENT,
- PUBLIC
- 13,CREATE ROLLBACK SEGMENT,
- specifies that the rollback segment be available to any instance
- 14,CREATE ROLLBACK SEGMENT,
- requesting it. If omitted, the rollback segment is private.
- 15,CREATE ROLLBACK SEGMENT,
-
- 16,CREATE ROLLBACK SEGMENT,
- rollback_segment_name
- 17,CREATE ROLLBACK SEGMENT,
- is an ORACLE identifier of up to 30 characters.
- 18,CREATE ROLLBACK SEGMENT,
-
- 19,CREATE ROLLBACK SEGMENT,
- tablespace
- 20,CREATE ROLLBACK SEGMENT,
- is the tablespace in which the rollback segment is being created.
- 21,CREATE ROLLBACK SEGMENT,
- If omitted, the SYSTEM tablespace is used.
- 22,CREATE ROLLBACK SEGMENT,
-
- 23,CREATE ROLLBACK SEGMENT,
- See also: create tablespace, create database, alter rollback segment,
- 24,CREATE ROLLBACK SEGMENT,
- drop rollback segment, rollback, savepoint, commands, menu.
- 1,CREATE SEQUENCE,
-
- 2,CREATE SEQUENCE,
-
- 3,CREATE SEQUENCE,
- CREATE SEQUENCE
- 4,CREATE SEQUENCE,
- SQL statement
- 5,CREATE SEQUENCE,
- CREATE SEQUENCE user.sequence_name
- 6,CREATE SEQUENCE,
- INCREMENT BY n
- 7,CREATE SEQUENCE,
- START WITH n
- 8,CREATE SEQUENCE,
- MAXVALUE n | NOMAXVALUE
- 9,CREATE SEQUENCE,
- MINVALUE n | NOMINVALUE
- 10,CREATE SEQUENCE,
- CYCLE | NOCYCLE
- 11,CREATE SEQUENCE,
- CACHE 20 | n | NOCACHE
- 12,CREATE SEQUENCE,
- ORDER | NOORDER
- 13,CREATE SEQUENCE,
-
- 14,CREATE SEQUENCE,
- CREATE SEQUENCE sets up an ORACLE object from which users can generate
- 15,CREATE SEQUENCE,
- unique integers. You can use sequence numbers to generate primary keys
- 16,CREATE SEQUENCE,
- automatically.
- 17,CREATE SEQUENCE,
-
- 18,CREATE SEQUENCE,
- user
- 19,CREATE SEQUENCE,
- is the sequence owner. The default is the user who is running
- 20,CREATE SEQUENCE,
- the CREATE SEQUENCE statement.
- 21,CREATE SEQUENCE,
-
- 22,CREATE SEQUENCE,
- INCREMENT BY n
- 23,CREATE SEQUENCE,
- sets the interval between sequence numbers. If n is positive, the
- 24,CREATE SEQUENCE,
- sequence ascends; if negative, it descends. The default is 1.
- 25,CREATE SEQUENCE,
-
- 26,CREATE SEQUENCE,
- START WITH n
- 27,CREATE SEQUENCE,
- is the first sequence number to be created. The default for an
- 28,CREATE SEQUENCE,
- ascending sequence is MINVALUE; for a descending sequence, the
- 29,CREATE SEQUENCE,
- default is MAXVALUE.
- 30,CREATE SEQUENCE,
-
- 31,CREATE SEQUENCE,
- MAXVALUE n | NOMAXVALUE
- 32,CREATE SEQUENCE,
- is the largest number the sequence will generate. The default is
- 33,CREATE SEQUENCE,
- 10e27-1 for an ascending sequence, 1 for a descending sequence.
- 34,CREATE SEQUENCE,
-
- 35,CREATE SEQUENCE,
- MINVALUE n | NOMINVALUE
- 36,CREATE SEQUENCE,
- is the smallest number the sequence will generate. The default is
- 37,CREATE SEQUENCE,
- 1 for an ascending sequence, 10e27-1 for a descending sequence.
- 38,CREATE SEQUENCE,
-
- 39,CREATE SEQUENCE,
- CYCLE | NOCYCLE
- 40,CREATE SEQUENCE,
- If CYCLE, the sequence goes to MINVALUE after reaching MAXVALUE
- 41,CREATE SEQUENCE,
- for ascending sequences, or to MAXVALUE after reaching MINVALUE
- 42,CREATE SEQUENCE,
- for descending sequences. If NOCYCLE (the default), no numbers
- 43,CREATE SEQUENCE,
- will be generated after the end of the sequence is reached.
- 44,CREATE SEQUENCE,
-
- 45,CREATE SEQUENCE,
- CACHE n | NOCACHE
- 46,CREATE SEQUENCE,
- CACHE pre-allocates sequence numbers so they may be kept in memory
- 47,CREATE SEQUENCE,
- to improve generation speed. The CACHE value must be less than
- 48,CREATE SEQUENCE,
- MAXVALUE minus MINVALUE. The default is CACHE 20.
- 49,CREATE SEQUENCE,
-
- 50,CREATE SEQUENCE,
- ORDER | NOORDER
- 51,CREATE SEQUENCE,
- ORDER guarantees that sequence numbers will be generated in order
- 52,CREATE SEQUENCE,
- of request, important for sequence numbers used as timestamps.
- 53,CREATE SEQUENCE,
- Even with NOORDER (the default), sequence numbers are usually
- 54,CREATE SEQUENCE,
- generated in order.
- 55,CREATE SEQUENCE,
-
- 56,CREATE SEQUENCE,
-
- 57,CREATE SEQUENCE,
- See also: sequences, nextval, keys, alter sequence, audit, drop sequence,
- 58,CREATE SEQUENCE,
- commands, menu.
- 1,CREATE SYNONYM,
-
- 2,CREATE SYNONYM,
-
- 3,CREATE SYNONYM,
- CREATE SYNONYM
- 4,CREATE SYNONYM,
- SQL statement
- 5,CREATE SYNONYM,
- CREATE PUBLIC SYNONYM user.synonym_name
- 6,CREATE SYNONYM,
- FOR user.table_or_view @databaselink
- 7,CREATE SYNONYM,
-
- 8,CREATE SYNONYM,
- CREATE SYNONYM creates a synonym for a table or view. A private synonym
- 9,CREATE SYNONYM,
- name must be different from any other object owned by the same user.
- 10,CREATE SYNONYM,
-
- 11,CREATE SYNONYM,
- PUBLIC
- 12,CREATE SYNONYM,
- specifies that the synonym be accessible by all users. If omitted,
- 13,CREATE SYNONYM,
- the synonym is private, accessible only by the synonym's creator.
- 14,CREATE SYNONYM,
-
- 15,CREATE SYNONYM,
- user
- 16,CREATE SYNONYM,
- is a username. If omitted, ORACLE assumes you own the table/view.
- 17,CREATE SYNONYM,
-
- 18,CREATE SYNONYM,
- databaselink
- 19,CREATE SYNONYM,
- is an existing link to a remote database. If user is omitted, the
- 20,CREATE SYNONYM,
- synonym refers to a table belonging to the databaselink username.
- 21,CREATE SYNONYM,
-
- 22,CREATE SYNONYM,
-
- 23,CREATE SYNONYM,
- See also: synonyms, user id, create database link, create table,
- 24,CREATE SYNONYM,
- create view, remote databases, menu.
- 1,CREATE TABLE,
-
- 2,CREATE TABLE,
-
- 3,CREATE TABLE,
- CREATE TABLE
- 4,CREATE TABLE,
- SQL statement
- 5,CREATE TABLE,
- CREATE TABLE user.table_name column_element | table_element,
- 6,CREATE TABLE,
- column_element | table_element,...
- 7,CREATE TABLE,
- PCTFREE n PCTUSED n
- 8,CREATE TABLE,
- INITRANS n MAXTRANS n
- 9,CREATE TABLE,
- TABLESPACE tablespace
- 10,CREATE TABLE,
- STORAGE storage
- 11,CREATE TABLE,
- CLUSTER cluster column, column,...
- 12,CREATE TABLE,
- AS query
- 13,CREATE TABLE,
-
- 14,CREATE TABLE,
- CREATE TABLE creates a table, with 1 to 254 columns. Unless a query is
- 15,CREATE TABLE,
- specified, the table is created with no data. Rows are normally added
- 16,CREATE TABLE,
- with the INSERT statement.
- 17,CREATE TABLE,
-
- 18,CREATE TABLE,
- user
- 19,CREATE TABLE,
- is the table's owner; the default is the current user.
- 20,CREATE TABLE,
-
- 21,CREATE TABLE,
- column_element
- 22,CREATE TABLE,
- defines the columns and optional column constraints of the table.
- 23,CREATE TABLE,
-
- 24,CREATE TABLE,
- table_element
- 25,CREATE TABLE,
- defines the table constraints.
- 26,CREATE TABLE,
-
- 27,CREATE TABLE,
- PCTFREE n
- 28,CREATE TABLE,
- specifies a positive integer from 0 - 100 as the percentage of
- 29,CREATE TABLE,
- room for future updates in every block allocated to the table;
- 30,CREATE TABLE,
- the default is 10. 100 is not a useful setting; no rows could
- 31,CREATE TABLE,
- be inserted. The combination of PCTFREE and PCTUSED determines
- 32,CREATE TABLE,
- whether inserted rows go into existing blocks or into new blocks.
- 33,CREATE TABLE,
-
- 34,CREATE TABLE,
- PCTUSED n
- 35,CREATE TABLE,
- sets a positive integer from 0 - 100 as the minimum level of space
- 36,CREATE TABLE,
- usage maintained for each block of the table; the default is 40.
- 37,CREATE TABLE,
- A block is listed as free (it can accept row insertions) when its
- 38,CREATE TABLE,
- space usage falls below PCTUSED. Blocks are removed from the free
- 39,CREATE TABLE,
- block list when insertions run space usage to the PCTFREE limit.
- 40,CREATE TABLE,
- A higher PCTUSED value results in more efficient use of space in
- 41,CREATE TABLE,
- the table at the expense of reduced performance.
- 42,CREATE TABLE,
-
- 43,CREATE TABLE,
- INITRANS n
- 44,CREATE TABLE,
- sets the initial number of transaction entries allocated within
- 45,CREATE TABLE,
- each block. The range is 1 - 255; the default is 1. ORACLE
- 46,CREATE TABLE,
- reserves 23 bytes in the block's free space for each transaction
- 47,CREATE TABLE,
- when the block is first used. When the number of concurrent
- 48,CREATE TABLE,
- transactions exceeds INITRANS, transaction entries are dynamically
- 49,CREATE TABLE,
- allocated up to MAXTRANS, or until the block runs out of free
- 50,CREATE TABLE,
- space.
- 51,CREATE TABLE,
-
- 52,CREATE TABLE,
- MAXTRANS n
- 53,CREATE TABLE,
- sets the maximun number of transactions that may update a block
- 54,CREATE TABLE,
- concurrently. The range is 1 - 255; the default is 255.
- 55,CREATE TABLE,
-
- 56,CREATE TABLE,
- tablespace
- 57,CREATE TABLE,
- is where the table will exist. The default tablespace is STORAGE.
- 58,CREATE TABLE,
-
- 59,CREATE TABLE,
- STORAGE
- 60,CREATE TABLE,
- sets future space allocation for the table.
- 61,CREATE TABLE,
-
- 62,CREATE TABLE,
- CLUSTER cluster column, column,...
- 63,CREATE TABLE,
- includes the table in the specified cluster, owned by the user.
- 64,CREATE TABLE,
- Specify one table column for each column in the cluster key, with
- 65,CREATE TABLE,
- the first table column corresponding to the first cluster column,
- 66,CREATE TABLE,
- and so on; table and cluster column names need not match. The
- 67,CREATE TABLE,
- cluster columns of a table are usually one or more columns in the
- 68,CREATE TABLE,
- table's primary key.
- 69,CREATE TABLE,
-
- 70,CREATE TABLE,
- query
- 71,CREATE TABLE,
- is a SELECT clause. The columns named in the query must match the
- 72,CREATE TABLE,
- columns in the CREATE TABLE statement; the datatypes and sizes of
- 73,CREATE TABLE,
- the new table's columns are copied from the columns in the query.
- 74,CREATE TABLE,
- If the query's columns have fully-defined and unique names, the
- 75,CREATE TABLE,
- columns may be omitted after CREATE TABLE, and the query's column
- 76,CREATE TABLE,
- names will be the column names in the new table. After creation,
- 77,CREATE TABLE,
- the results of the query are inserted in the new table. The query
- 78,CREATE TABLE,
- may not contain an ORDER BY or a FOR UPDATE OF clause.
- 79,CREATE TABLE,
-
- 80,CREATE TABLE,
- If a query is used, table_element may contain column names only.
- 81,CREATE TABLE,
- Use ALTER TABLE...ADD to add column and table constraints. To
- 82,CREATE TABLE,
- change column and table constraints, DROP the constraints and then
- 83,CREATE TABLE,
- ADD them. The query, if used, must contain the last CREATE TABLE
- 84,CREATE TABLE,
- clause.
- 85,CREATE TABLE,
-
- 86,CREATE TABLE,
- Example: To define the table staff, as user scott, you could enter:
- 87,CREATE TABLE,
-
- 88,CREATE TABLE,
- CREATE TABLE staff (
- 89,CREATE TABLE,
- empno NUMBER NOT NULL PRIMARY KEY,
- 90,CREATE TABLE,
- ename CHAR(20) NOT NULL CHECK (ename = UPPER),
- 91,CREATE TABLE,
- job CHAR(10),
- 92,CREATE TABLE,
- mgr NUMBER REFERENCES scott.staff(empno),
- 93,CREATE TABLE,
- hiredate DATE CHECK (hiredate >= SYSDATE - 7),
- 94,CREATE TABLE,
- sal NUMBER(10,2) CHECK (sal > 800),
- 95,CREATE TABLE,
- comm NUMBER(9,2) DEFAULT NULL,
- 96,CREATE TABLE,
- deptno NOT NULL REFERENCES scott.dept(deptno)
- 97,CREATE TABLE,
- )
- 98,CREATE TABLE,
- PCTFREE 5 PCTUSED 75
- 99,CREATE TABLE,
-
- 100,CREATE TABLE,
- See also: alter table, create cluster, create index, create tablespace,
- 101,CREATE TABLE,
- drop table, constraint, tables, commands, menu.
- 1,CREATE TABLESPACE,
-
- 2,CREATE TABLESPACE,
-
- 3,CREATE TABLESPACE,
- CREATE TABLESPACE
- 4,CREATE TABLESPACE,
- SQL statement
- 5,CREATE TABLESPACE,
- CREATE TABLESPACE tablespace
- 6,CREATE TABLESPACE,
- DATAFILE (filespec, filespec,...)
- 7,CREATE TABLESPACE,
- DEFAULT STORAGE storage
- 8,CREATE TABLESPACE,
- ONLINE | OFFLINE
- 9,CREATE TABLESPACE,
-
- 10,CREATE TABLESPACE,
- CREATE TABLESPACE creates a tablespace with the names of the files in it,
- 11,CREATE TABLESPACE,
- default storage parameters, and whether the tablespace will be online or
- 12,CREATE TABLESPACE,
- offline after its creation. DBA privileges are required.
- 13,CREATE TABLESPACE,
-
- 14,CREATE TABLESPACE,
- filespec
- 15,CREATE TABLESPACE,
- is a database file as: 'filename SIZE integer K | M REUSE
- 16,CREATE TABLESPACE,
- REUSE specifies that any existing file with that name is reused,
- 17,CREATE TABLESPACE,
- erasing any data it may contain.
- 18,CREATE TABLESPACE,
-
- 19,CREATE TABLESPACE,
- A tablespace is the unit of backup and recovery in a database, containing
- 20,CREATE TABLESPACE,
- table, index, rollback, and temporary segments. The tablespace SYSTEM is
- 21,CREATE TABLESPACE,
- created when a database is created. System files may be added dynamically
- 22,CREATE TABLESPACE,
- when a tablespace is online or offline. Take a tablespace offline before
- 23,CREATE TABLESPACE,
- dropping it. Create at least one rollback segment for a tablespace.
- 24,CREATE TABLESPACE,
-
- 25,CREATE TABLESPACE,
- See also: alter tablespace, drop tablespace, commands, menu.
- 1,CREATE VIEW,
-
- 2,CREATE VIEW,
-
- 3,CREATE VIEW,
- CREATE VIEW
- 4,CREATE VIEW,
- SQL statement
- 5,CREATE VIEW,
- CREATE VIEW user.view_name alias, alias,...
- 6,CREATE VIEW,
- AS query
- 7,CREATE VIEW,
- WITH CHECK OPTION CONSTRAINT constraint
- 8,CREATE VIEW,
-
- 9,CREATE VIEW,
- CREATE VIEW defines a logical window to one or more tables or other views.
- 10,CREATE VIEW,
-
- 11,CREATE VIEW,
- query
- 12,CREATE VIEW,
- is a SELECT statement (without ORDER BY or FOR UPDATE OF) that
- 13,CREATE VIEW,
- identifies the columns and rows of the table(s) the view uses.
- 14,CREATE VIEW,
-
- 15,CREATE VIEW,
- WITH CHECK OPTION
- 16,CREATE VIEW,
- specifies that inserts and updates done through the view will not
- 17,CREATE VIEW,
- result in rows the view cannot access, useful if the view is based
- 18,CREATE VIEW,
- on another view.
- 19,CREATE VIEW,
-
- 20,CREATE VIEW,
- You may use a view instead of a table in SELECT, INSERT, UPDATE, or DELETE
- 21,CREATE VIEW,
- statements, but you may SELECT from a view only if the view query has:
- 22,CREATE VIEW,
-
- 23,CREATE VIEW,
- - a join
- 24,CREATE VIEW,
- - a GROUP BY, CONNECT BY, or START WITH clause
- 25,CREATE VIEW,
- - the DISTINCT clause, pseudo-columns (like ROWNUM), or expressions
- 26,CREATE VIEW,
- in the column list. You may UPDATE a view that has pseudo-columns
- 27,CREATE VIEW,
- or expressions if the UPDATE does not refer to them.
- 28,CREATE VIEW,
-
- 29,CREATE VIEW,
- See also: views, create table, create synonym, drop view, rename, menu.
- 1,Commands,
-
- 2,Commands,
-
- 3,Commands,
- Commands
- 4,Commands,
- (Type help and then all
- 5,Commands,
- SQL*Plus COMMANDS SQL and PL/SQL STATEMENTS or part of a topic name)
- 6,Commands,
- --------------------- -----------------------------------------------------
- 7,Commands,
- @ get alter cluster create sequence noaudit
- 8,Commands,
- / host alter database create synonym null
- 9,Commands,
- accept input alter index create table open
- 10,Commands,
- append list alter rollback create tablespace raise
- 11,Commands,
- break pause alter sequence create view rename
- 12,Commands,
- btitle prompt alter table declare revoke
- 13,Commands,
- change remark alter tablespace delete rollback
- 14,Commands,
- clear run alter user drop (objectname) savepoint
- 15,Commands,
- column runform audit end select
- 16,Commands,
- compute save begin exception set transaction
- 17,Commands,
- connect set close exit update
- 18,Commands,
- copy show comment fetch validate index
- 19,Commands,
- define spool commit goto constraints
- 20,Commands,
- del sqlplus create cluster grant
- 21,Commands,
- describe start create database if ====== SEE ALSO ======
- 22,Commands,
- disconnect timing create db link insert menu (of help topics)
- 23,Commands,
- edit undefine create index lock table old commands (SQLPlus)
- 24,Commands,
- exit whenever create rollback loop examples (SQL-PL/SQL)
- 1,Comments,
-
- 2,Comments,
-
- 3,Comments,
- Comments (SQL and PL/SQL)
- 4,Comments,
-
- 5,Comments,
- Comments are notes inserted for clarification; they have no effect
- 6,Comments,
- on statement processing. In PL/SQL, you can begin a comment with --
- 7,Comments,
- (two hyphens); this type of comment ends with the end of the line:
- 8,Comments,
-
- 9,Comments,
- x NUMBER := 0; --initializes local copy of x
- 10,Comments,
- BEGIN
- 11,Comments,
- FOR i IN 1..4 LOOP
- 12,Comments,
- x := x+1; --increments local x
- 13,Comments,
-
- 14,Comments,
- In SQL and PL/SQL, you can begin a comment with /* and use as many
- 15,Comments,
- lines as you wish to comment, then end with */ as shown below. Use
- 16,Comments,
- /* and */ to surround parts of code you wish to temporary exclude.
- 17,Comments,
-
- 18,Comments,
- SELECT ename, sal, mgr /* Get the name, salary, and manager
- 19,Comments,
- for employees earning $2000 or more. */
- 20,Comments,
- FROM emp
- 21,Comments,
- WHERE sal >= 2000;
- 22,Comments,
-
- 23,Comments,
-
- 24,Comments,
- See also: comment, commands, menu.
- 1,Comparison Operators,
-
- 2,Comparison Operators,
-
- 3,Comparison Operators,
- Comparison Operators
- 4,Comparison Operators,
-
- 5,Comparison Operators,
- Operator Meaning/Function in SQL Operator Meaning/Function
- 6,Comparison Operators,
- -----------------------------------------------------------------------------
- 7,Comparison Operators,
- = Equal to BETWEEN Greater than or equal
- 8,Comparison Operators,
- != <> Not equal to to term 1, less than
- 9,Comparison Operators,
- >= Greater than or equal to or equal to term 2
- 10,Comparison Operators,
- <= Less than or equal to
- 11,Comparison Operators,
- IN Equal to any member of NOT Not greater or equal
- 12,Comparison Operators,
- NOT IN Not equal to any member of BETWEEN to term 1, not less
- 13,Comparison Operators,
- or equal to term 2
- 14,Comparison Operators,
- ANY Compares a value to each
- 15,Comparison Operators,
- list value; must preface EXISTS True if subquery re-
- 16,Comparison Operators,
- with =, !=, >, <, <=, >= turns 1 or more rows
- 17,Comparison Operators,
- ALL Compares a value to every IS NULL True if value is null
- 18,Comparison Operators,
- list value; must preface (= NULL won't work)
- 19,Comparison Operators,
- with =, !=, >, <, <=, >= IS NOT NULL True if value is not
- 20,Comparison Operators,
- null (avoid != NULL)
- 21,Comparison Operators,
- All return TRUE, FALSE or NULL.
- 22,Comparison Operators,
-
- 23,Comparison Operators,
- See also: like, boolean comparisons, subquery, nulls, menu.
- 1,Conditions,
-
- 2,Conditions,
-
- 3,Conditions,
- Conditions
- 4,Conditions,
-
- 5,Conditions,
- A SQL condition is one or more expressions and logical operators
- 6,Conditions,
- that returns either TRUE or FALSE. You can use conditions:
- 7,Conditions,
-
- 8,Conditions,
- - in the WHERE clause of SELECT, INSERT, UPDATE, and DELETE:
- 9,Conditions,
-
- 10,Conditions,
- SELECT ename, sal FROM emp WHERE job = 'ANALYST'...
- 11,Conditions,
-
- 12,Conditions,
- - in the CONNECT BY, START WITH, and HAVING clauses of SELECT:
- 13,Conditions,
-
- 14,Conditions,
- SELECT ename, mgr FROM emp
- 15,Conditions,
- CONNECT BY PRIOR empno = mgr START WITH ename = 'KING';
- 16,Conditions,
-
- 17,Conditions,
- In PL/SQL, IF statements and WHILE loops also require conditions.
- 18,Conditions,
-
- 19,Conditions,
-
- 20,Conditions,
- See also: logical operators, where, select, insert, update, delete,
- 21,Conditions,
- connect by, if, while (loops), comparison (operators),
- 22,Conditions,
- boolean comparisons, menu.
- 1,Constraints,
-
- 2,Constraints,
-
- 3,Constraints,
- Constraints
- 4,Constraints,
- SQL language
- 5,Constraints,
- Table Constraint Syntax:
- 6,Constraints,
-
- 7,Constraints,
- UNIQUE | PRIMARY KEY column, column,...
- 8,Constraints,
- CONSTRAINT constraint_name
- 9,Constraints,
- FOREIGN KEY column, column,...
- 10,Constraints,
- REFERENCES user.table column, column,...
- 11,Constraints,
- CONSTRAINT constraint_name
- 12,Constraints,
- CHECK condition CONSTRAINT constraint_name
- 13,Constraints,
-
- 14,Constraints,
- Column Constraint Syntax:
- 15,Constraints,
-
- 16,Constraints,
- column NULL | NOT NULL CONSTRAINT constraint_name
- 17,Constraints,
- UNIQUE | PRIMARY KEY CONSTRAINT constraint_name
- 18,Constraints,
- REFERENCES user.table column CONSTRAINT constraint_name
- 19,Constraints,
- CHECK condition CONSTRAINT constraint_name
- 20,Constraints,
-
- 21,Constraints,
-
- 22,Constraints,
- A constraint clause restricts the range of valid values for one column
- 23,Constraints,
- (a column constraint) or for a group of columns (a table constraint).
- 24,Constraints,
- Any INSERT, UPDATE, or DELETE statement evaluates a relevant constraint;
- 25,Constraints,
- the constraint must be satisfied for the statement to succeed.
- 26,Constraints,
-
- 27,Constraints,
- Table constraint definitions are part of the global table definition,
- 28,Constraints,
- as in: CREATE TABLE project_employee (PROJECT NUMBER,
- 29,Constraints,
- EMPLOYEE NUMBER, PRIMARY KEY (PROJECT, EMPLOYEE))
- 30,Constraints,
-
- 31,Constraints,
- Column constraints are local to a specific column, as in:
- 32,Constraints,
- CREATE TABLE dept (DEPTNO NUMBER PRIMARY KEY,...)
- 33,Constraints,
-
- 34,Constraints,
- Constraints must be used in CREATE TABLE or ALTER TABLE. Use ALTER TABLE
- 35,Constraints,
- to add or drop constraints from a table. Constraints are recorded in the
- 36,Constraints,
- data dictionary. If you don't name a constraint, it is assigned the name
- 37,Constraints,
- SYS_Cn, where n is an integer that makes the name unique in the database.
- 38,Constraints,
-
- 39,Constraints,
-
- 40,Constraints,
- column
- 41,Constraints,
- is the name of a column to which the constraint applies.
- 42,Constraints,
-
- 43,Constraints,
- NULL or NOT NULL
- 44,Constraints,
- enables or prohibits a column from containing null values.
- 45,Constraints,
-
- 46,Constraints,
- UNIQUE
- 47,Constraints,
- each row must have a distinct value for the column; each column
- 48,Constraints,
- must be declared NOT NULL; the column must not be a PRIMARY KEY.
- 49,Constraints,
-
- 50,Constraints,
- PRIMARY KEY
- 51,Constraints,
- specifies the column as the primary key.
- 52,Constraints,
-
- 53,Constraints,
- FOREIGN KEY column, column... REFERENCES user.table column, column...
- 54,Constraints,
- specifies the column(s) as a foreign key of user.table column.
- 55,Constraints,
- Default column(s) = the table's primary key. Details below.
- 56,Constraints,
-
- 57,Constraints,
- CHECK condition
- 58,Constraints,
- sets a condition the column must satisfy to exist in the table.
- 59,Constraints,
- In a column CHECK constraint, the condition may only refer to the
- 60,Constraints,
- column to which the constraint belongs. A table CHECK constraint
- 61,Constraints,
- condition may refer to multiple columns.
- 62,Constraints,
-
- 63,Constraints,
-
- 64,Constraints,
- The FOREIGN KEY/REFERENCES constraint:
- 65,Constraints,
-
- 66,Constraints,
- - rejects an INSERT or UPDATE of a value if a corresponding value does
- 67,Constraints,
- not currently exist in the primary key table;
- 68,Constraints,
-
- 69,Constraints,
- - rejects a DELETE if it would invalidate a REFERENCES constraint;
- 70,Constraints,
-
- 71,Constraints,
- - must reference a PRIMARY KEY or UNIQUE column(s) in primary key table;
- 72,Constraints,
-
- 73,Constraints,
- - will reference the PRIMARY KEY of the primary key table if no column
- 74,Constraints,
- or group of columns is specified in the constraint;
- 75,Constraints,
-
- 76,Constraints,
- - must reference a table, not a view or cluster;
- 77,Constraints,
-
- 78,Constraints,
- - requires that you own the primary key table, have REFERENCE privilege
- 79,Constraints,
- on it, or have column-level REFERENCE privilege on the referenced
- 80,Constraints,
- columns in the primary key table;
- 81,Constraints,
-
- 82,Constraints,
- - doesn't restrict how other constraints may reference the same tables;
- 83,Constraints,
-
- 84,Constraints,
- - requires that the foreign key column(s) and the constraint column(s)
- 85,Constraints,
- have matching datatypes;
- 86,Constraints,
-
- 87,Constraints,
- - may reference the same table named in the CREATE TABLE statement;
- 88,Constraints,
-
- 89,Constraints,
- - must not reference the same column more than once (in one constraint).
- 90,Constraints,
-
- 91,Constraints,
-
- 92,Constraints,
- See also: tables, keys, nulls, create table, commands, menu.
- 1,Conversion Functions,
-
- 2,Conversion Functions,
-
- 3,Conversion Functions,
- Conversion Functions
- 4,Conversion Functions,
-
- 5,Conversion Functions,
- SQL Conversion functions convert a value from one datatype to another:
- 6,Conversion Functions,
-
- 7,Conversion Functions,
- TO_CHAR(expr, fmt) Turns a number or date expr into characters shown
- 8,Conversion Functions,
- in the format specified by fmt (optional).
- 9,Conversion Functions,
- TO_DATE(char, fmt) Turns a char date in fmt format into a date value.
- 10,Conversion Functions,
- TO_NUMBER(char) Turns a CHAR number into its NUMBER datatype value.
- 11,Conversion Functions,
-
- 12,Conversion Functions,
- CHARTOROWID(char) Turns character values in char into ROWID values.
- 13,Conversion Functions,
- ROWIDTOCHAR(ROWID) Turns ROWID values into character values.
- 14,Conversion Functions,
-
- 15,Conversion Functions,
- CONVERT(char, Converts char to a new character set implementation
- 16,Conversion Functions,
- new, source) from its source implementation.
- 17,Conversion Functions,
-
- 18,Conversion Functions,
- HEXTORAW(char) Turns char hexadecimal digits into binary (raw).
- 19,Conversion Functions,
- RAWTOHEX(raw) Turns raw (binary) into character (hex) values.
- 20,Conversion Functions,
-
- 21,Conversion Functions,
-
- 22,Conversion Functions,
- See also: char, date, number, implicit conversions, pseudo-columns,
- 23,Conversion Functions,
- format numbers, format dates, format modifiers, menu.
- 1,Correlated Subquery,
-
- 2,Correlated Subquery,
-
- 3,Correlated Subquery,
- Correlated Subquery
- 4,Correlated Subquery,
-
- 5,Correlated Subquery,
- A correlated subquery evaluates a query for EVERY ROW in the parent
- 6,Correlated Subquery,
- statement. Use a table or alias name with each column for clarity:
- 7,Correlated Subquery,
-
- 8,Correlated Subquery,
- SELECT column_list FROM table1 alias1 WHERE expr operator
- 9,Correlated Subquery,
- (SELECT column_list
- 10,Correlated Subquery,
- FROM table2 alias2
- 11,Correlated Subquery,
- WHERE alias1.column operator alias2.column);
- 12,Correlated Subquery,
-
- 13,Correlated Subquery,
- UPDATE column_list SET column =
- 14,Correlated Subquery,
- (SELECT expr
- 15,Correlated Subquery,
- FROM table2 alias2
- 16,Correlated Subquery,
- WHERE alias1.column = alias2.column);
- 17,Correlated Subquery,
-
- 18,Correlated Subquery,
- DELETE FROM table1 alias1 WHERE column operator
- 19,Correlated Subquery,
- (SELECT expr
- 20,Correlated Subquery,
- FROM table2 alias2
- 21,Correlated Subquery,
- WHERE alias1.column = alias2.column);
- 22,Correlated Subquery,
-
- 23,Correlated Subquery,
- See also: example correlated subquery, example delete, query, alias,
- 24,Correlated Subquery,
- select, where, update, delete, uses of select, menu.
- 1,Cursor Attributes,
-
- 2,Cursor Attributes,
-
- 3,Cursor Attributes,
- Cursor Attributes
- 4,Cursor Attributes,
-
- 5,Cursor Attributes,
- Expression Cursor opened; Last FETCH Last FETCH
- 6,Cursor Attributes,
- before 1st FETCH returned row returned no row
- 7,Cursor Attributes,
- ---------------------------------------------------------------------------
- 8,Cursor Attributes,
- cursor_name%FOUND Returns NULL Returns TRUE Returns FALSE
- 9,Cursor Attributes,
-
- 10,Cursor Attributes,
- cursor_name%NOTFOUND Returns NULL Returns FALSE Returns TRUE
- 11,Cursor Attributes,
-
- 12,Cursor Attributes,
- cursor_name%ROWCOUNT Returns a 0 Returns total
- 13,Cursor Attributes,
- number of rows
- 14,Cursor Attributes,
- FETCHed since
- 15,Cursor Attributes,
- OPEN (cumulative)
- 16,Cursor Attributes,
- cursor_name%ISOPEN Returns TRUE
- 17,Cursor Attributes,
- if cursor is
- 18,Cursor Attributes,
- OPEN, FALSE
- 19,Cursor Attributes,
- if closed
- 20,Cursor Attributes,
-
- 21,Cursor Attributes,
-
- 22,Cursor Attributes,
- %FOUND, %NOTFOUND, and %ROWCOUNT raise the INVALID_CURSOR exception
- 23,Cursor Attributes,
- (ORA-01001) if the cursor is not OPEN.
- 24,Cursor Attributes,
-
- 25,Cursor Attributes,
- See also: open, fetch, nulls, cursors, error handling,
- 26,Cursor Attributes,
- attributes (%type and %rowtype), commands, menu.
- 1,Cursor FOR,
-
- 2,Cursor FOR,
-
- 3,Cursor FOR,
- Cursor FOR
- 4,Cursor FOR,
- PL/SQL statement
- 5,Cursor FOR,
-
- 6,Cursor FOR,
- FOR record_name IN cursor_name(parameter, parameter,...) LOOP
- 7,Cursor FOR,
- sequence_of_statements
- 8,Cursor FOR,
- END LOOP;
- 9,Cursor FOR,
-
- 10,Cursor FOR,
- In a cursor FOR loop, PL/SQL issues an implicit OPEN cursor at the
- 11,Cursor FOR,
- beginning, then an implicit FETCH cursor INTO record_name for every
- 12,Cursor FOR,
- row that satisfies the query associated with cursor_name, executing
- 13,Cursor FOR,
- the sequence_of_statements. When no rows are left to fetch, PL/SQL
- 14,Cursor FOR,
- issues an implicit CLOSE cursor and exits the loop. The cursor_name
- 15,Cursor FOR,
- must be previously declared and closed as the loop begins. Optional
- 16,Cursor FOR,
- parameter values are used as the cursor is implicitly opened before
- 17,Cursor FOR,
- the loop's first execution. Parameter datatypes must be compatible
- 18,Cursor FOR,
- or convertible to previously declared cursor parameter datatypes.
- 19,Cursor FOR,
-
- 20,Cursor FOR,
- Record_name is implicitly declared as cursor_name%ROWTYPE datatype.
- 21,Cursor FOR,
- You reference the returned values by record_name.column_name.
- 22,Cursor FOR,
-
- 23,Cursor FOR,
- For other loops see: loop, while, numeric for.
- 24,Cursor FOR,
- See also: example cursor for, open, fetch, implicit conversions,
- 25,Cursor FOR,
- attributes, managing cursors, commands, menu.
- 1,Cursors,
-
- 2,Cursors,
-
- 3,Cursors,
- Cursors
- 4,Cursors,
-
- 5,Cursors,
- The cursor is a PL/SQL work area that holds the row currently being
- 6,Cursors,
- processed. The topics below describe cursor control during UPDATE,
- 7,Cursors,
- INSERT, and DELETE operations. Type help, a space, and then the
- 8,Cursors,
- topic you want to see:
- 9,Cursors,
-
- 10,Cursors,
- declare cursor
- 11,Cursors,
- open
- 12,Cursors,
- fetch
- 13,Cursors,
- close
- 14,Cursors,
- cursor for loops
- 15,Cursors,
- cursor attributes (explicit)
- 16,Cursors,
- sql% cursor (implicit)
- 17,Cursors,
- where current of
- 18,Cursors,
-
- 19,Cursors,
-
- 20,Cursors,
- See also: update, insert, delete, menu.
- 1,DATE,
-
- 2,DATE,
-
- 3,DATE,
- DATE
- 4,DATE,
- DATE
- 5,DATE,
-
- 6,DATE,
- For each date value, a DATE column stores the century, year, month,
- 7,DATE,
- day, hour, minute, and second. The 24-hour format is used for time.
- 8,DATE,
-
- 9,DATE,
- Defaults: If you insert a date with no time: 00:00:00 midnight
- 10,DATE,
- If you insert a time with no date: current date (SYSDATE)
- 11,DATE,
- If you don't specify a date format: DD-MON-YY ('09-JAN-42')
- 12,DATE,
-
- 13,DATE,
- You can add and subtract numbers to and from dates, and subtract
- 14,DATE,
- dates from dates: SYSDATE + 1 = tomorrow;
- 15,DATE,
- SYSDATE - HIREDATE = total days employed
- 16,DATE,
-
- 17,DATE,
-
- 18,DATE,
- The appearance of dates in reports is controlled by date functions,
- 19,DATE,
- date formats, and modifiers of date formats.
- 20,DATE,
-
- 21,DATE,
-
- 22,DATE,
- See also: date functions, format dates, format modifiers, char, number,
- 23,DATE,
- boolean, raw, menu.
- 1,DBA,
-
- 2,DBA,
-
- 3,DBA,
- DBA
- 4,DBA,
-
- 5,DBA,
- DBA username SYSTEM owns and has all privileges on PRODUCT_USER_PROFILE.
- 6,DBA,
- Other users should have only SELECT access to this table. Command file
- 7,DBA,
- PUPBLD, when run, grants SELECT access on PRODUCT_USER_PROFILE to PUBLIC.
- 8,DBA,
-
- 9,DBA,
- To disable a SQL or SQL*Plus command for a given user, the DBA inserts a
- 10,DBA,
- row with the username in the USERID column, the command in the ATTRIBUTE
- 11,DBA,
- column, and DISABLED in the CHAR_VALUE column. The SCOPE, NUMERIC_VALUE,
- 12,DBA,
- and DATE_VALUE columns should contain null. For example:
- 13,DBA,
-
- 14,DBA,
- NUMERIC CHAR DATE
- 15,DBA,
- PRODUCT USERID ATTRIBUTE SCOPE VALUE VALUE VALUE
- 16,DBA,
- -------- ------ --------- ----- ------- -------- -----
- 17,DBA,
- SQL*Plus SCOTT HOST DISABLED
- 18,DBA,
- SQL*Plus % INSERT DISABLED
- 19,DBA,
- SQL*Plus % UPDATE DISABLED
- 20,DBA,
- SQL*Plus % DELETE DISABLED
- 21,DBA,
-
- 22,DBA,
-
- 23,DBA,
- To re-enable a command, the DBA deletes the row with the restriction.
- 24,DBA,
-
- 25,DBA,
- The DBA can use the PRODUCT_USER_PROFILE table to disable the following:
- 26,DBA,
-
- 27,DBA,
- SQL*Plus Commands SQL Commands
- 28,DBA,
- ----------------- ------------------------------
- 29,DBA,
- CONNECT QUIT ALTER DROP RENAME
- 30,DBA,
- EDIT RUN AUDIT GRANT REVOKE
- 31,DBA,
- EXIT SAVE CONNECT INSERT SELECT
- 32,DBA,
- GET SPOOL CREATE LOCK UPDATE
- 33,DBA,
- HOST START DELETE NOAUDIT VALIDATE
- 34,DBA,
-
- 35,DBA,
- Columns in the PRODUCT_USER_PROFILE table:
- 36,DBA,
-
- 37,DBA,
- PRODUCT contains the product name (SQL*Plus in this case). Wildcards
- 38,DBA,
- and nulls are not permitted.
- 39,DBA,
-
- 40,DBA,
- USERID contains the username (in CAPITALS) for whom the command is
- 41,DBA,
- being disabled. To disable the command for more than one user,
- 42,DBA,
- use the % SQL wildcard or make multiple entries.
- 43,DBA,
-
- 44,DBA,
- ATTRIBUTE contains the command (in CAPITALS) being disabled.
- 45,DBA,
- Wildcards are not permitted.
- 46,DBA,
-
- 47,DBA,
- SCOPE is ignored for SQL*Plus. We recommend a NULL here.
- 48,DBA,
-
- 49,DBA,
- NUMERIC_VALUE is ignored for SQL*Plus. We recommend a NULL here.
- 50,DBA,
-
- 51,DBA,
- CHAR_VALUE must contain "DISABLED". Wildcards are not permitted.
- 52,DBA,
-
- 53,DBA,
- DATE_VALUE is ignored for SQL*Plus. We recommend a NULL here.
- 54,DBA,
-
- 55,DBA,
- See also: commands, menu.
- 1,DECLARE,
-
- 2,DECLARE,
- DECLARE
- 3,DECLARE,
- PL/SQL statement
- 4,DECLARE,
- DECLARE
- 5,DECLARE,
- constant_name CONSTANT datatype;
- 6,DECLARE,
- variable_name datatype;
- 7,DECLARE,
- CURSOR cursor_name;
- 8,DECLARE,
- exception_name EXCEPTION;
- 9,DECLARE,
- BEGIN
- 10,DECLARE,
- ...
- 11,DECLARE,
-
- 12,DECLARE,
- DECLARE starts declarations of variables and constants which can only
- 13,DECLARE,
- be referenced in the current block and its sub-blocks, but not by the
- 14,DECLARE,
- enclosing block.
- 15,DECLARE,
-
- 16,DECLARE,
- The DECLARE section is optional. It ends with a BEGIN statement.
- 17,DECLARE,
-
- 18,DECLARE,
-
- 19,DECLARE,
- See also: example while, variables, char, number, date, exception,
- 20,DECLARE,
- declare cursor, begin, blocks, commands, menu.
- 1,DECLARE CURSOR,
-
- 2,DECLARE CURSOR,
-
- 3,DECLARE CURSOR,
- DECLARE CURSOR
- 4,DECLARE CURSOR,
- PL/SQL statement
- 5,DECLARE CURSOR,
- DECLARE
- 6,DECLARE CURSOR,
- CURSOR cursor_name
- 7,DECLARE CURSOR,
- (parameter_name datatype),... --optional
- 8,DECLARE CURSOR,
- IS SELECT_statement
- 9,DECLARE CURSOR,
- FOR UPDATE OF column_name; --required if UPDATE or DELETE
- 10,DECLARE CURSOR,
- ... statements in this block use
- 11,DECLARE CURSOR,
- the WHERE CURRENT OF clause.
- 12,DECLARE CURSOR,
-
- 13,DECLARE CURSOR,
- DECLARE CURSOR names a cursor and associates a query with it. If you
- 14,DECLARE CURSOR,
- use parameter_names in the declaration, you must also use them in the
- 15,DECLARE CURSOR,
- SELECT_statement which defines the query associated with cursor_name.
- 16,DECLARE CURSOR,
- For clarity, make parameter_names different from column names.
- 17,DECLARE CURSOR,
-
- 18,DECLARE CURSOR,
- Datatype is CHAR, NUMBER, DATE, or BOOLEAN, with no restrictions.
- 19,DECLARE CURSOR,
-
- 20,DECLARE CURSOR,
-
- 21,DECLARE CURSOR,
- See also: cursors, example cursors, update, delete, where current of,
- 22,DECLARE CURSOR,
- query, char, number, date, boolean, declare, commands, menu.
- 1,DEFINE,
-
- 2,DEFINE,
-
- 3,DEFINE,
- DEFINE
- 4,DEFINE,
-
- 5,DEFINE,
- DEF[INE] [ variable ] | [ variable = text ]
- 6,DEFINE,
-
- 7,DEFINE,
- DEFINE specifies a user variable and assigns it a CHAR value, or lists
- 8,DEFINE,
- the value and variable type of a single variable or all variables.
- 9,DEFINE,
-
- 10,DEFINE,
- variable
- 11,DEFINE,
- is the user variable whose value you wish to assign or list.
- 12,DEFINE,
- Enter DEFINE followed by variable to list the value and type of
- 13,DEFINE,
- variable. Enter DEFINE with no clauses to list the values and
- 14,DEFINE,
- types of all user variables.
- 15,DEFINE,
-
- 16,DEFINE,
- variable = text
- 17,DEFINE,
- defines (names) a user variable and assigns it a CHAR value.
- 18,DEFINE,
-
- 19,DEFINE,
- text
- 20,DEFINE,
- is the CHAR value you wish to assign to variable. Enclose text in
- 21,DEFINE,
- 'single quotes' if it contains punctuation or blanks.
- 22,DEFINE,
-
- 23,DEFINE,
- DEFINEd variables retain their values until you:
- 24,DEFINE,
-
- 25,DEFINE,
- - enter a new DEFINE command referencing the variable, or
- 26,DEFINE,
- - enter an UNDEFINE command referencing the variable, or
- 27,DEFINE,
- - enter an ACCEPT command referencing the variable, or
- 28,DEFINE,
- - reference the variable in the NEW_VALUE or OLD_VALUE clause of
- 29,DEFINE,
- the COLUMN command, and reference the column in a subsequent SQL
- 30,DEFINE,
- SELECT statement, or
- 31,DEFINE,
- - EXIT SQL*Plus.
- 32,DEFINE,
-
- 33,DEFINE,
- When you run a stored query or a command file, SQL*Plus substitutes the
- 34,DEFINE,
- value of variable for each substitution variable referencing &variable or
- 35,DEFINE,
- &&variable. SQL*Plus will not prompt you for the value of variable in
- 36,DEFINE,
- the session until you UNDEFINE variable. You can DEFINE a maximum of 240
- 37,DEFINE,
- variables. Note that you can use DEFINE to define the _EDITOR variable,
- 38,DEFINE,
- which establishes the host system editor invoked by the EDIT command.
- 39,DEFINE,
-
- 40,DEFINE,
- If you continue the value of a DEFINEd variable on multiple lines with the
- 41,DEFINE,
- SQL*Plus command continuation character, each continuation character and
- 42,DEFINE,
- carriage return you enter are replaced with a space in the resulting
- 43,DEFINE,
- variable. For example, SQL*Plus interprets
- 44,DEFINE,
-
- 45,DEFINE,
- SQL> DEFINE TEXT = 'ONE-
- 46,DEFINE,
- > TWO-
- 47,DEFINE,
- > THREE'
- 48,DEFINE,
-
- 49,DEFINE,
- as: SQL> DEFINE TEXT = 'ONE TWO THREE'
- 50,DEFINE,
-
- 51,DEFINE,
- Examples: To assign the value MANAGER to the variable POS, enter:
- 52,DEFINE,
-
- 53,DEFINE,
- SQL> DEFINE POS = MANAGER
- 54,DEFINE,
-
- 55,DEFINE,
- If you execute a command with a reference to &POS, SQL*Plus
- 56,DEFINE,
- substitutes the value MANAGER for &POS, and will not prompt you
- 57,DEFINE,
- for a POS value. To assign the CHAR value 20 to the variable
- 58,DEFINE,
- DEPTNO, enter:
- 59,DEFINE,
-
- 60,DEFINE,
- SQL> DEFINE DEPTNO = 20
- 61,DEFINE,
-
- 62,DEFINE,
- Even though you enter the number 20, SQL*Plus assigns a CHAR
- 63,DEFINE,
- value to DEPTNO consisting of two characters, 2 and 0. To see
- 64,DEFINE,
- the definition of DEPTNO, enter:
- 65,DEFINE,
-
- 66,DEFINE,
- SQL> DEFINE DEPTNO
- 67,DEFINE,
-
- 68,DEFINE,
- Result:
- 69,DEFINE,
-
- 70,DEFINE,
- DEFINE DEPTNO = "20" (CHAR)
- 71,DEFINE,
-
- 72,DEFINE,
-
- 73,DEFINE,
- See also: accept, column, edit, parameters, undefine, commands, menu.
- 1,DEL,
-
- 2,DEL,
-
- 3,DEL,
- DEL
- 4,DEL,
-
- 5,DEL,
- DEL
- 6,DEL,
-
- 7,DEL,
- DEL deletes the current line of the buffer, making the following line of
- 8,DEL,
- the buffer (if any) the current line. To delete several consecutive
- 9,DEL,
- lines, enter DEL several times.
- 10,DEL,
-
- 11,DEL,
-
- 12,DEL,
- Examples: The SQL buffer contains the following query:
- 13,DEL,
-
- 14,DEL,
- SQL> LIST
- 15,DEL,
- 1 SELECT ENAME, DEPTNO
- 16,DEL,
- 2 FROM EMP
- 17,DEL,
- 3 WHERE JOB = 'SALESMAN'
- 18,DEL,
- 4* ORDER BY DEPTNO
- 19,DEL,
-
- 20,DEL,
- To make the line with the WHERE clause the current line, enter:
- 21,DEL,
-
- 22,DEL,
- SQL> LIST 3
- 23,DEL,
- 3* WHERE JOB = 'SALESMAN'
- 24,DEL,
-
- 25,DEL,
- To delete the WHERE clause, enter:
- 26,DEL,
-
- 27,DEL,
- SQL> DEL
- 28,DEL,
-
- 29,DEL,
- The SQL buffer now contains:
- 30,DEL,
-
- 31,DEL,
- SQL> LIST
- 32,DEL,
- 1 SELECT ENAME, DEPTNO
- 33,DEL,
- 2 FROM EMP
- 34,DEL,
- 3* ORDER BY DEPTNO
- 35,DEL,
-
- 36,DEL,
-
- 37,DEL,
- See also: append, change, edit, input, list, save, set (buffer), spool,
- 38,DEL,
- commands, menu.
- 1,DELETE,
-
- 2,DELETE,
-
- 3,DELETE,
- DELETE
- 4,DELETE,
-
- 5,DELETE,
- SQL version: PL/SQL version:
- 6,DELETE,
-
- 7,DELETE,
- DELETE FROM table_or_view DELETE FROM table_or_view
- 8,DELETE,
- WHERE clause; WHERE CURRENT OF cursor_name;
- 9,DELETE,
-
- 10,DELETE,
-
- 11,DELETE,
- DELETE removes one or more rows from the table or view you specify.
- 12,DELETE,
- The WHERE clause specifies the rows to remove. To remove all rows,
- 13,DELETE,
- omit the WHERE clause.
- 14,DELETE,
-
- 15,DELETE,
- In PL/SQL, use DELETE with the WHERE CURRENT OF cursor_name clause
- 16,DELETE,
- to remove only the current row--the one last accessed with a FETCH.
- 17,DELETE,
-
- 18,DELETE,
- Use the implicit SQL% cursor and explicit cursor attributes to gain
- 19,DELETE,
- information about the execution of a PL/SQL DELETE statement.
- 20,DELETE,
-
- 21,DELETE,
- See also: example delete, where, where current of, sql% cursor,
- 22,DELETE,
- cursor attributes, bnf syntax, examples, menu.
- 1,DESCRIBE,
-
- 2,DESCRIBE,
-
- 3,DESCRIBE,
- DESCRIBE
- 4,DESCRIBE,
-
- 5,DESCRIBE,
- DESC[RIBE] [user.] object [@database_link_name]
- 6,DESCRIBE,
-
- 7,DESCRIBE,
- DESCRIBE lists the column definitions for a table, view, or synonym.
- 8,DESCRIBE,
-
- 9,DESCRIBE,
- user
- 10,DESCRIBE,
- is the owner of the object. Omit user if you own the object.
- 11,DESCRIBE,
-
- 12,DESCRIBE,
- object
- 13,DESCRIBE,
- is a table, view, or synonym.
- 14,DESCRIBE,
-
- 15,DESCRIBE,
- database_link_name
- 16,DESCRIBE,
- is the node name and database where object exists. The syntax
- 17,DESCRIBE,
- depends on the SQL*Net your computer uses. See LINKS for more
- 18,DESCRIBE,
- information on database links.
- 19,DESCRIBE,
-
- 20,DESCRIBE,
- For each column, the description lists:
- 21,DESCRIBE,
-
- 22,DESCRIBE,
- - the column's name
- 23,DESCRIBE,
- - whether null values are allowed (NULL or NOT NULL) for the column
- 24,DESCRIBE,
- - the column's datatype
- 25,DESCRIBE,
- - the column's precision (and scale, if any, for a numeric column)
- 26,DESCRIBE,
-
- 27,DESCRIBE,
-
- 28,DESCRIBE,
- Example: To describe the EMP table, enter:
- 29,DESCRIBE,
-
- 30,DESCRIBE,
- SQL> DESCRIBE EMP
- 31,DESCRIBE,
-
- 32,DESCRIBE,
- Output: Name Null? Type
- 33,DESCRIBE,
- ---------- -------- -----------
- 34,DESCRIBE,
- EMPNO NOT NULL NUMBER(4)
- 35,DESCRIBE,
- ENAME CHAR(10)
- 36,DESCRIBE,
- JOB CHAR(9)
- 37,DESCRIBE,
- MGR NUMBER(4)
- 38,DESCRIBE,
- HIREDATE DATE
- 39,DESCRIBE,
- SAL NUMBER(7,2)
- 40,DESCRIBE,
- COMM NUMBER(7,2)
- 41,DESCRIBE,
- DEPTNO NUMBER(2)
- 42,DESCRIBE,
-
- 43,DESCRIBE,
-
- 44,DESCRIBE,
- See also: links, tables, views (and indexes), commands, menu.
- 1,DISCONNECT,
-
- 2,DISCONNECT,
-
- 3,DISCONNECT,
- DISCONNECT
- 4,DISCONNECT,
-
- 5,DISCONNECT,
- DISC[ONNECT]
- 6,DISCONNECT,
-
- 7,DISCONNECT,
- DISCONNECT commits pending changes to the database and logs the current
- 8,DISCONNECT,
- user off ORACLE, but does not exit SQL*Plus. Use EXIT or QUIT to log off
- 9,DISCONNECT,
- ORACLE and return control to your host computer's operating system.
- 10,DISCONNECT,
-
- 11,DISCONNECT,
-
- 12,DISCONNECT,
- Example: Your command file might begin with a CONNECT command and end
- 13,DISCONNECT,
- with a DISCONNECT:
- 14,DISCONNECT,
-
- 15,DISCONNECT,
- SQL> GET MYFILE
- 16,DISCONNECT,
- 1 CONNECT ...
- 17,DISCONNECT,
- .
- 18,DISCONNECT,
- .
- 19,DISCONNECT,
- .
- 20,DISCONNECT,
- 15* DISCONNECT
- 21,DISCONNECT,
-
- 22,DISCONNECT,
-
- 23,DISCONNECT,
- See also: connect, exit, host, quit, SQLPlus, commands, menu.
- 1,DROP CLUSTER,
-
- 2,DROP CLUSTER,
-
- 3,DROP CLUSTER,
- DROP CLUSTER
- 4,DROP CLUSTER,
- SQL statement
- 5,DROP CLUSTER,
- DROP CLUSTER user.cluster INCLUDING TABLES
- 6,DROP CLUSTER,
-
- 7,DROP CLUSTER,
- DROP CLUSTER removes the specified cluster from the database. Dropping a
- 8,DROP CLUSTER,
- cluster also drops the cluster index and returns all cluster space to the
- 9,DROP CLUSTER,
- appropriate tablespace(s). You need DBA privileges to drop a cluster that
- 10,DROP CLUSTER,
- was created by another user.
- 11,DROP CLUSTER,
-
- 12,DROP CLUSTER,
- INCLUDING TABLES
- 13,DROP CLUSTER,
- drops all tables that belong to the cluster. If omitted, the
- 14,DROP CLUSTER,
- tables must have been dropped before you can drop the cluster.
- 15,DROP CLUSTER,
-
- 16,DROP CLUSTER,
- Dropping a clustered table also removes it from the cluster. You cannot
- 17,DROP CLUSTER,
- uncluster an individual table; to get the same result, create a new table
- 18,DROP CLUSTER,
- like the old one, but without the CLUSTER option:
- 19,DROP CLUSTER,
-
- 20,DROP CLUSTER,
- CREATE TABLE new AS SELECT * FROM old
- 21,DROP CLUSTER,
-
- 22,DROP CLUSTER,
- Then drop the old table: DROP TABLE old
- 23,DROP CLUSTER,
- and rename the new table: RENAME new TO old
- 24,DROP CLUSTER,
-
- 25,DROP CLUSTER,
- See also: drop table, create cluster, alter cluster, commands, menu.
- 1,DROP DATABASE LINK,
-
- 2,DROP DATABASE LINK,
-
- 3,DROP DATABASE LINK,
- DROP DATABASE LINK
- 4,DROP DATABASE LINK,
- SQL statement
- 5,DROP DATABASE LINK,
- DROP PUBLIC DATABASE LINK link_name
- 6,DROP DATABASE LINK,
-
- 7,DROP DATABASE LINK,
-
- 8,DROP DATABASE LINK,
- DROP DATABASE LINK removes the specified database link. PUBLIC must be
- 9,DROP DATABASE LINK,
- included if the database link is accessible to all users; you must have
- 10,DROP DATABASE LINK,
- DBA privileges to use the PUBLIC clause, or to drop a database link that
- 11,DROP DATABASE LINK,
- you do not own.
- 12,DROP DATABASE LINK,
-
- 13,DROP DATABASE LINK,
-
- 14,DROP DATABASE LINK,
- See also: links, remote databases, create db link, commands, menu.
- 1,DROP INDEX,
-
- 2,DROP INDEX,
-
- 3,DROP INDEX,
- DROP INDEX
- 4,DROP INDEX,
- SQL statement
- 5,DROP INDEX,
- DROP INDEX user.index
- 6,DROP INDEX,
-
- 7,DROP INDEX,
-
- 8,DROP INDEX,
- DROP INDEX removes the specified index from the database. You must own
- 9,DROP INDEX,
- an index to drop it, unless you have DBA privileges. If user is omitted,
- 10,DROP INDEX,
- the user issuing DROP INDEX is assumed.
- 11,DROP INDEX,
-
- 12,DROP INDEX,
- When an index is dropped, all blocks allocated to it are returned to the
- 13,DROP INDEX,
- index's tablespace.
- 14,DROP INDEX,
-
- 15,DROP INDEX,
-
- 16,DROP INDEX,
- See also: alter index, create index, create table, commands, menu.
- 1,DROP ROLLBACK SEGMENT,
-
- 2,DROP ROLLBACK SEGMENT,
-
- 3,DROP ROLLBACK SEGMENT,
- DROP ROLLBACK SEGMENT
- 4,DROP ROLLBACK SEGMENT,
- SQL statement
- 5,DROP ROLLBACK SEGMENT,
- DROP PUBLIC ROLLBACK SEGMENT segment
- 6,DROP ROLLBACK SEGMENT,
-
- 7,DROP ROLLBACK SEGMENT,
- DROP ROLLBACK SEGMENT removes the specified rollback segment. The PUBLIC
- 8,DROP ROLLBACK SEGMENT,
- clause must be included if the rollback segment is public. Only a DBA can
- 9,DROP ROLLBACK SEGMENT,
- drop a rollback segment; only rollback segments not in use can be dropped.
- 10,DROP ROLLBACK SEGMENT,
-
- 11,DROP ROLLBACK SEGMENT,
- All space allocated to a dropped rollback segment is returned to its
- 12,DROP ROLLBACK SEGMENT,
- tablespace.
- 13,DROP ROLLBACK SEGMENT,
-
- 14,DROP ROLLBACK SEGMENT,
-
- 15,DROP ROLLBACK SEGMENT,
-
- 16,DROP ROLLBACK SEGMENT,
- See also: rollback, alter rollback, create rollback, create tablespace,
- 17,DROP ROLLBACK SEGMENT,
- dba, commands, menu.
- 1,DROP SEQUENCE,
-
- 2,DROP SEQUENCE,
-
- 3,DROP SEQUENCE,
- DROP SEQUENCE
- 4,DROP SEQUENCE,
- SQL statement
- 5,DROP SEQUENCE,
- DROP SEQUENCE user.sequence
- 6,DROP SEQUENCE,
-
- 7,DROP SEQUENCE,
-
- 8,DROP SEQUENCE,
- DROP SEQUENCE removes the specified sequence from the database. You must
- 9,DROP SEQUENCE,
- own an index to drop it, unless you have DBA privileges. The user issuing
- 10,DROP SEQUENCE,
- DROP SEQUENCE is assumed if user is omitted.
- 11,DROP SEQUENCE,
-
- 12,DROP SEQUENCE,
- One way to restart a sequence is to drop and recreate it; for example,
- 13,DROP SEQUENCE,
- if sequence POWERS (which you own) is at 288, and you want to restart
- 14,DROP SEQUENCE,
- it at 12, you can:
- 15,DROP SEQUENCE,
-
- 16,DROP SEQUENCE,
- DROP SEQUENCE powers
- 17,DROP SEQUENCE,
-
- 18,DROP SEQUENCE,
- CREATE SEQUENCE powers . . .
- 19,DROP SEQUENCE,
- START WITH 12
- 20,DROP SEQUENCE,
-
- 21,DROP SEQUENCE,
-
- 22,DROP SEQUENCE,
- See also: sequences, alter sequence, create sequence, commands, menu.
- 1,DROP SYNONYM,
-
- 2,DROP SYNONYM,
-
- 3,DROP SYNONYM,
- DROP SYNONYM
- 4,DROP SYNONYM,
- SQL statement
- 5,DROP SYNONYM,
- DROP PUBLIC SYNONYM user.synonym
- 6,DROP SYNONYM,
-
- 7,DROP SYNONYM,
- DROP SYNONYM removes the specified synonym from the database. PUBLIC must
- 8,DROP SYNONYM,
- be specified if the synonym is accessible to all users. You must have DBA
- 9,DROP SYNONYM,
- privilege to use the PUBLIC clause, or to drop a synonym you do not own.
- 10,DROP SYNONYM,
-
- 11,DROP SYNONYM,
- To alter a synonym, drop and recreate it.
- 12,DROP SYNONYM,
-
- 13,DROP SYNONYM,
-
- 14,DROP SYNONYM,
- See also: synonyms, create synonym, commands, menu.
- 1,DROP TABLE,
-
- 2,DROP TABLE,
-
- 3,DROP TABLE,
- DROP TABLE
- 4,DROP TABLE,
- SQL statement
- 5,DROP TABLE,
- DROP TABLE user.table
- 6,DROP TABLE,
-
- 7,DROP TABLE,
- DROP TABLE removes the specified table from the database and deletes all
- 8,DROP TABLE,
- it's rows. To drop a table, you must own it or have DBA privileges.
- 9,DROP TABLE,
-
- 10,DROP TABLE,
- All indexes are dropped with the table. Views and synonyms referring to
- 11,DROP TABLE,
- the table are not dropped, but become invalid; you should drop them also,
- 12,DROP TABLE,
- or redefine them so they become valid again.
- 13,DROP TABLE,
-
- 14,DROP TABLE,
- Blocks allocated to the table are returned to the tablespaces containing
- 15,DROP TABLE,
- the data and the indexes, unless the table was clustered.
- 16,DROP TABLE,
-
- 17,DROP TABLE,
- DROP CLUSTER INCLUDING TABLES drops all tables in a cluster.
- 18,DROP TABLE,
-
- 19,DROP TABLE,
- It is wise to check the data dictionary table USER_CROSS_REFS to see if
- 20,DROP TABLE,
- any views depend on the table you are about to drop.
- 21,DROP TABLE,
-
- 22,DROP TABLE,
-
- 23,DROP TABLE,
- See also: drop cluster, alter table, create index, create table, tables,
- 24,DROP TABLE,
- commands, menu.
- 1,DROP TABLESPACE,
-
- 2,DROP TABLESPACE,
-
- 3,DROP TABLESPACE,
- DROP TABLESPACE
- 4,DROP TABLESPACE,
- SQL statement
- 5,DROP TABLESPACE,
- DROP TABLESPACE tablespace INCLUDING CONTENTS
- 6,DROP TABLESPACE,
-
- 7,DROP TABLESPACE,
- DROP TABLESPACE removes the specified tablespace from the database. The
- 8,DROP TABLESPACE,
- tablespace SYSTEM may not be dropped. Only a DBA may drop a tablespace.
- 9,DROP TABLESPACE,
-
- 10,DROP TABLESPACE,
- INCLUDING CONTENTS
- 11,DROP TABLESPACE,
- drops all objects in the tablespace, including tables, clusters,
- 12,DROP TABLESPACE,
- rollback segments, and temporary segments. If INCLUDING CONTENTS
- 13,DROP TABLESPACE,
- is omitted, the tablespace must be empty in order to be dropped.
- 14,DROP TABLESPACE,
-
- 15,DROP TABLESPACE,
-
- 16,DROP TABLESPACE,
- Take a tablespace offline before trying to drop it; a tablespace cannot
- 17,DROP TABLESPACE,
- be dropped while users are accessing its data, index, rollback segments,
- 18,DROP TABLESPACE,
- or temporary segments.
- 19,DROP TABLESPACE,
-
- 20,DROP TABLESPACE,
-
- 21,DROP TABLESPACE,
- See also: alter tablespace, create database, create tablespace, dba,
- 22,DROP TABLESPACE,
- commands, menu.
- 1,DROP VIEW,
-
- 2,DROP VIEW,
-
- 3,DROP VIEW,
- DROP VIEW
- 4,DROP VIEW,
- SQL statement
- 5,DROP VIEW,
- DROP VIEW user.view
- 6,DROP VIEW,
-
- 7,DROP VIEW,
- DROP VIEW removes the specified view from the database. To drop a view,
- 8,DROP VIEW,
- you must own it or have DBA privileges.
- 9,DROP VIEW,
-
- 10,DROP VIEW,
- When you drop a view, any views and synonyms that refer to the view are
- 11,DROP VIEW,
- not dropped, but become invalid. You should drop them also, or redefine
- 12,DROP VIEW,
- them so they become valid again.
- 13,DROP VIEW,
-
- 14,DROP VIEW,
- To alter a view, drop and recreate it.
- 15,DROP VIEW,
-
- 16,DROP VIEW,
- It's wise to check the data dictionary table USER_CROSS_REFS to see if
- 17,DROP VIEW,
- other views depend on the one you are about to drop.
- 18,DROP VIEW,
-
- 19,DROP VIEW,
-
- 20,DROP VIEW,
-
- 21,DROP VIEW,
- See also: views, synonyms, create table, create view, create synonym,
- 22,DROP VIEW,
- data dictionary, commands, menu.
- 1,Data Dictionary,
-
- 2,Data Dictionary,
-
- 3,Data Dictionary,
- Data Dictionary
- 4,Data Dictionary,
-
- 5,Data Dictionary,
- The data dictionary stores information about ORACLE objects and events,
- 6,Data Dictionary,
- accessible to the user through a variety of views. For a complete list
- 7,Data Dictionary,
- of data dictionary tables and views, query DICTIONARY.
- 8,Data Dictionary,
-
- 9,Data Dictionary,
- Name of View Description
- 10,Data Dictionary,
- ---------------------------------------------------------------------------
- 11,Data Dictionary,
- ACCESSIBLE_COLUMNS columns of all tables, views, and clusters
- 12,Data Dictionary,
- ACCESSIBLE_TABLES tables and views accessible to the user
- 13,Data Dictionary,
- AUDIT_ACTIONS maps action type numbers to action type names
- 14,Data Dictionary,
- ALL_CATALOG accessible tables, views, synonyms, and sequences
- 15,Data Dictionary,
- ALL_COL_COMMENTS comments on columns of accessible tables & views
- 16,Data Dictionary,
- ALL_COL_GRANTS grants on columns where the user is the grantor,
- 17,Data Dictionary,
- grantee, or owner, or PUBLIC is the grantee
- 18,Data Dictionary,
- ALL_COL_GRANTS_MADE grants on columns where user is grantor or owner
- 19,Data Dictionary,
- ALL_COL_GRANTS_RECD grants on columns where user or PUBLIC is grantee
- 20,Data Dictionary,
- ALL_DB_LINKS database links accessible to the user
- 21,Data Dictionary,
- ALL_DEF_AUDIT_OPTS table and system level default auditing options
- 22,Data Dictionary,
- ALL_INDEXES descriptions of indexes on accessible tables
- 23,Data Dictionary,
- ALL_IND_COLUMNS columns comprising indexes on accessible tables
- 24,Data Dictionary,
- ALL_OBJECTS objects accessible to the user
- 25,Data Dictionary,
- ALL_SEQUENCES descriptions of the user's own sequences
- 26,Data Dictionary,
-
- 27,Data Dictionary,
- Name of View Description of Data Dictionary View
- 28,Data Dictionary,
- --------------------------------------------------------------------------
- 29,Data Dictionary,
- ALL_SYNONYMS synonyms accessible to the user
- 30,Data Dictionary,
- ALL_TABLES description of tables accessible to the user
- 31,Data Dictionary,
- ALL_TAB_AUDIT_OPTS auditing options for accessible tables and views
- 32,Data Dictionary,
- ALL_TAB_COLUMNS columns of all tables, views, and clusters
- 33,Data Dictionary,
- ALL_TAB_COMMENTS comments on tables and views accessible to user
- 34,Data Dictionary,
- ALL_TAB_GRANTS grants on objects where the user is the grantor,
- 35,Data Dictionary,
- grantee, or owner, or PUBLIC is the grantee
- 36,Data Dictionary,
- ALL_TAB_GRANTS_MADE user's grants and grants on user's objects
- 37,Data Dictionary,
- ALL_TAB_GRANTS_RECD grants on objects where user or PUBLIC is grantee
- 38,Data Dictionary,
- ALL_USERS information about all users of the database
- 39,Data Dictionary,
- ALL_VIEWS text of views available to the user
- 40,Data Dictionary,
- AUDIT_ACTIONS each action code and its description
- 41,Data Dictionary,
- COLUMN_PRIVILEGES same as ALL_COL_GRANTS
- 42,Data Dictionary,
- CONSTRAINT_COLUMNS accessible columns in constraint definitions
- 43,Data Dictionary,
- CONSTRAINT_DEFS constraint definitions on accessible tables
- 44,Data Dictionary,
- DICTIONARY description of data dictionary tables and views
- 45,Data Dictionary,
- DICT_COLUMNS columns in data dictionary tables and views
- 46,Data Dictionary,
- TABLE_PRIVILEGES same as ALL_TAB_GRANTS
- 47,Data Dictionary,
- USER_AUDIT_CONNECT audit trails for user logons and logoffs
- 48,Data Dictionary,
- USER_AUDIT_TRAIL audit trail entries relevant to the user
- 49,Data Dictionary,
- USER_CATALOG accessible tables, views, synonyms, and sequences
- 50,Data Dictionary,
-
- 51,Data Dictionary,
- Name of View Description of Data Dictionary View
- 52,Data Dictionary,
- ------------------------------------------------------------------------
- 53,Data Dictionary,
- USER_CLUSTERS descriptions of user's own clusters
- 54,Data Dictionary,
- USER_CLU_COLUMNS mapping of table columns to cluster columns
- 55,Data Dictionary,
- USER_COL_COMMENTS comments on columns of user's tables and views
- 56,Data Dictionary,
- USER_COL_GRANTS grants on columns where the user is the owner,
- 57,Data Dictionary,
- grantor, or grantee
- 58,Data Dictionary,
- USER_COL_GRANTS_MADE grants on columns of objects owned by the user
- 59,Data Dictionary,
- USER_COL_GRANTS_RECD grants on columns where the user is the grantee
- 60,Data Dictionary,
- USER_CROSS_REF cross ref for user's views, synonyms, constraints
- 61,Data Dictionary,
- USER_DB_LINKS database links owned by the user
- 62,Data Dictionary,
- USER_EXTENTS extents comprising segments owned by the user
- 63,Data Dictionary,
- USER_FREE_SPACE free extents in tablespaces owned by the user
- 64,Data Dictionary,
- USER_INDEXES descriptions of the user's own indexes
- 65,Data Dictionary,
- USER_IND_COLUMNS columns comprising indexes on the user's tables
- 66,Data Dictionary,
- USER_OBJECTS objects owned by the user
- 67,Data Dictionary,
- USER_SEGMENTS storage allocated for all database segments
- 68,Data Dictionary,
- USER_SEQUENCES descriptions of the user's own sequences
- 69,Data Dictionary,
- USER_SYNONYMS the user's private synonyms
- 70,Data Dictionary,
- USER_TABLES descriptions of the user's own tables
- 71,Data Dictionary,
- USER_TABLESPACES description of accessible tablespaces
- 72,Data Dictionary,
- USER_TAB_AUDIT_OPTS auditing options for the user's tables and views
- 73,Data Dictionary,
- USER_TAB_COLUMNS columns of the user's tables, views, and clusters
- 74,Data Dictionary,
-
- 75,Data Dictionary,
- Name of View Description of Data Dictionary View
- 76,Data Dictionary,
- ------------------------------------------------------------------------
- 77,Data Dictionary,
- USER_TAB_COMMENTS comments on tables and views owned by the user
- 78,Data Dictionary,
- USER_TAB_GRANTS grants on objects where the user is the owner,
- 79,Data Dictionary,
- grantor, or grantee
- 80,Data Dictionary,
- USER_TAB_GRANTS_MADE grants on objects owned by the user
- 81,Data Dictionary,
- USER_TAB_GRANTS_RECD grants on objects where the user is the grantee
- 82,Data Dictionary,
- USER_TS_QUOTAS tablespace quotas for the user
- 83,Data Dictionary,
- USER_USERS information about the current user
- 84,Data Dictionary,
- USER_VIEWS text of views owned by the user
- 85,Data Dictionary,
-
- 86,Data Dictionary,
-
- 87,Data Dictionary,
- See also: sequences, synonyms, commands, menu.
- 1,Date Functions,
-
- 2,Date Functions,
-
- 3,Date Functions,
- Date Functions
- 4,Date Functions,
-
- 5,Date Functions,
- Most of these return DATE values; MONTHS_BETWEEN returns a numeric value:
- 6,Date Functions,
-
- 7,Date Functions,
- ADD_MONTHS(d, n) Returns date d with n months more; n = integer.
- 8,Date Functions,
- LAST_DAY(d) Returns date of the last day of d date's month.
- 9,Date Functions,
- MONTHS_BETWEEN(d, e) Returns number of months between dates d and e.
- 10,Date Functions,
- NEW_TIME(d, a, b) Given date d in time zone a, returns date/time in
- 11,Date Functions,
- zone b, using time zone abbreviations (below).
- 12,Date Functions,
- NEXT_DAY(d, day) Returns date of the day (Tue) coming after date d.
- 13,Date Functions,
- SYSDATE Returns the current date and time.
- 14,Date Functions,
- ROUND(d, format) Returns d rounded by a specified format (below).
- 15,Date Functions,
- TRUNC(d, format) Returns d truncated by a specified format (below);
- 16,Date Functions,
- TRUNC with no format strips time from a date.
- 17,Date Functions,
-
- 18,Date Functions,
- Time Zone Standard Daylight Time Zone Standard Daylight
- 19,Date Functions,
- ----------------------------- --------------------------------
- 20,Date Functions,
- Atlantic 'AST' 'ADT' Hawaii/Alaska 'HST' 'HDT'
- 21,Date Functions,
- Bering 'BST' 'BDT' Mountain 'MST' 'MDT'
- 22,Date Functions,
- Central 'CST' 'CDT' Newfoundland 'NST' ---
- 23,Date Functions,
- Eastern 'EST' 'EDT' Pacific 'PST' 'PDT'
- 24,Date Functions,
- Greenwich Mean Time = 'GMT' Yukon 'YST' 'YDT'
- 25,Date Functions,
-
- 26,Date Functions,
-
- 27,Date Functions,
-
- 28,Date Functions,
- Format ROUND or TRUNC to Format ROUND/TRUNC to
- 29,Date Functions,
- -------------------------------------------------------------------------
- 30,Date Functions,
- CC century WW week of YEAR
- 31,Date Functions,
- SCC century B.C. W week of MONTH
- 32,Date Functions,
- YYYY/YEAR/YYY year (rounds up on 7/1) DDD/DD/J day
- 33,Date Functions,
- YY/Y/SYEAR DAY/DY/D nearest Sunday
- 34,Date Functions,
- Q quarter (rounds up on HH/HH12/HH24 hour
- 35,Date Functions,
- 16th of 2nd mo) MI minute
- 36,Date Functions,
- MONTH/MON/MM month (rounds up on 16th)
- 37,Date Functions,
-
- 38,Date Functions,
-
- 39,Date Functions,
-
- 40,Date Functions,
- More functions: 1 row char, 1 row number, conversion, error reporting,
- 41,Date Functions,
- group, other functions.
- 42,Date Functions,
-
- 43,Date Functions,
-
- 44,Date Functions,
- See also: date (datatype), format dates, format modifiers, menu.
- 1,Delimiters,
-
- 2,Delimiters,
- Delimiters
- 3,Delimiters,
-
- 4,Delimiters,
- ( ) operator; encloses parameters
- 5,Delimiters,
- + - * / arithmetic operators
- 6,Delimiters,
- = < > logical operators
- 7,Delimiters,
- ; ends a SQL statement
- 8,Delimiters,
- % indicates a PL/SQL attribute
- 9,Delimiters,
- , separates items in a list
- 10,Delimiters,
- . references table.field_names and PL/SQL record.field_names.
- 11,Delimiters,
- (Use a . on a line by itself to end a PL/SQL block.)
- 12,Delimiters,
- @ references remote databases; @ filename executes a command file
- 13,Delimiters,
- ' ' encloses a 'character string'
- 14,Delimiters,
- " " allows anything in identifiers
- 15,Delimiters,
- : host variable/bind parameters
- 16,Delimiters,
- <> != ~= ^= <= >= PL/SQL relational operators
- 17,Delimiters,
- << >> encloses loop, block, and GOTO label names in PL/SQL
- 18,Delimiters,
- -- comment to the end of a line in PL/SQL blocks
- 19,Delimiters,
- /* begin multi-line comment
- 20,Delimiters,
- */ end multi-line comment
- 21,Delimiters,
- .. numeric FOR loop range in PL/SQL
- 22,Delimiters,
- := variable assignment in PL/SQL
- 23,Delimiters,
- ** exponentiation
- 24,Delimiters,
- || string concatenation
- 25,Delimiters,
- See also: identifiers, arithmetic, commands, menu.
- 1,Distributed Query,
-
- 2,Distributed Query,
- Distributed Query
- 3,Distributed Query,
-
- 4,Distributed Query,
- A distributed query requires the use of a database link between
- 5,Distributed Query,
- systems with SQL*Net. The syntax is the same as other queries;
- 6,Distributed Query,
- a database link name or its synonym follows the table name:
- 7,Distributed Query,
-
- 8,Distributed Query,
- SELECT column2, column3,...
- 9,Distributed Query,
- FROM remote_table@database_link, local_table
- 10,Distributed Query,
- WHERE remote_table.column1 = local_table.column_1;
- 11,Distributed Query,
-
- 12,Distributed Query,
-
- 13,Distributed Query,
- Remote table references are supported in FROM clauses of SELECT
- 14,Distributed Query,
- and INSERT INTO...SELECT statements, and in table qualifiers of
- 15,Distributed Query,
- column references in these statements.
- 16,Distributed Query,
-
- 17,Distributed Query,
-
- 18,Distributed Query,
-
- 19,Distributed Query,
- See also: links, remote databases, synonyms, select, insert, from,
- 20,Distributed Query,
- uses of select, menu.
- 1,EDIT,
-
- 2,EDIT,
-
- 3,EDIT,
- EDIT
- 4,EDIT,
-
- 5,EDIT,
- EDIT [ file_name[.ext ] ]
- 6,EDIT,
-
- 7,EDIT,
- EDIT invokes a host operating system text editor on the contents of the
- 8,EDIT,
- specified file or on the contents of the buffer.
- 9,EDIT,
-
- 10,EDIT,
- file_name[.ext ]
- 11,EDIT,
- is the file to edit (typically a command file). If you omit ext,
- 12,EDIT,
- the default command file extension (normally SQL) is assumed.
- 13,EDIT,
- See the SET command's SUFFIX variable for information on changing
- 14,EDIT,
- the default extension. Enter EDIT with no file_name to edit the
- 15,EDIT,
- SQL buffer's contents with the host operating system editor.
- 16,EDIT,
-
- 17,EDIT,
- The user variable _EDITOR contains the name of the text editor invoked by
- 18,EDIT,
- EDIT; to change the text editor, change the _EDITOR name. See DEFINE for
- 19,EDIT,
- information on changing the value of a user variable. If _EDITOR is
- 20,EDIT,
- undefined, EDIT tries to use the default host operating system editor.
- 21,EDIT,
-
- 22,EDIT,
- EDIT alone places the buffer's contents in a file named AFIEDT.BUF in your
- 23,EDIT,
- current working directory, then invokes the text editor on the contents of
- 24,EDIT,
- that file. The text is saved back into the SQL buffer. EDIT returns an
- 25,EDIT,
- error message if you don't specify a file name and the buffer is empty. To
- 26,EDIT,
- leave the editing session and return to SQL*Plus, terminate the editing
- 27,EDIT,
- session in the way customary for the text editor.
- 28,EDIT,
-
- 29,EDIT,
-
- 30,EDIT,
- Example: To edit the file REPORT with the extension SQL using your host
- 31,EDIT,
- operating system text editor, enter:
- 32,EDIT,
-
- 33,EDIT,
- SQL> EDIT REPORT
- 34,EDIT,
-
- 35,EDIT,
-
- 36,EDIT,
- See also: append, change, del, define, input, list, save, spool, undefine,
- 37,EDIT,
- commands, menu.
- 1,END,
-
- 2,END,
- END
- 3,END,
- PL/SQL statements
- 4,END,
-
- 5,END,
- <<label_name_1>> --<<label_name>> is optional; if
- 6,END,
- BEGIN used before BEGIN it must also
- 7,END,
- rest_of_block appear at the END of the block.
- 8,END,
- END label_name_1;
- 9,END,
-
- 10,END,
- previous_LOOP_statement_part
- 11,END,
- END LOOP label_name; --label_name is optional
- 12,END,
-
- 13,END,
- previous_IF_statement_part
- 14,END,
- END IF;
- 15,END,
-
- 16,END,
- END must be the last statement in each PL/SQL block. A label_name
- 17,END,
- permits you to reference an enclosing block's declarations, or an
- 18,END,
- outer loop's index.
- 19,END,
-
- 20,END,
-
- 21,END,
- See also: example numeric for, begin, loop, if, blocks, declare,
- 22,END,
- commands, menu.
- 1,EXCEPTION,
-
- 2,EXCEPTION,
-
- 3,EXCEPTION,
- EXCEPTION
- 4,EXCEPTION,
- PL/SQL statement
- 5,EXCEPTION,
-
- 6,EXCEPTION,
- EXCEPTION --section is optional
- 7,EXCEPTION,
- WHEN exception_name THEN statements;
- 8,EXCEPTION,
- WHEN exception_name OR exception_name THEN statements;
- 9,EXCEPTION,
- ...
- 10,EXCEPTION,
- WHEN OTHERS THEN sequence_of_statements; --optional
- 11,EXCEPTION,
-
- 12,EXCEPTION,
- Exception handling routines are specified before the END of a block.
- 13,EXCEPTION,
- Each WHEN clause names an exception and defines actions to be taken
- 14,EXCEPTION,
- when the exception is raised. User-defined exceptions are declared
- 15,EXCEPTION,
- in the current block's (or in an enclosing block's) DECLARE section.
- 16,EXCEPTION,
- There are also predefined internal PL/SQL exceptions.
- 17,EXCEPTION,
-
- 18,EXCEPTION,
- OTHERS handles any exceptions not explicitly named; it must be last.
- 19,EXCEPTION,
-
- 20,EXCEPTION,
-
- 21,EXCEPTION,
- See also: example error handling, error handling, blocks, declare,
- 22,EXCEPTION,
- pl/sql exceptions, commands, menu.
- 1,EXIT,
-
- 2,EXIT,
-
- 3,EXIT,
- EXIT
- 4,EXIT,
-
- 5,EXIT,
- {EXIT | QUIT} [SUCCESS | FAILURE | WARNING | n | variable]
- 6,EXIT,
-
- 7,EXIT,
- EXIT commits all pending database changes, leaves SQL*Plus, and returns
- 8,EXIT,
- control to the operating system.
- 9,EXIT,
-
- 10,EXIT,
- {EXIT | QUIT}
- 11,EXIT,
- can be used interchangeably.
- 12,EXIT,
-
- 13,EXIT,
- SUCCESS
- 14,EXIT,
- exits normally.
- 15,EXIT,
-
- 16,EXIT,
- FAILURE
- 17,EXIT,
- exits with a return code indicating failure.
- 18,EXIT,
-
- 19,EXIT,
- WARNING
- 20,EXIT,
- exits with a return code indicating warning. EXIT with no clauses
- 21,EXIT,
- exits with a value of SUCCESS.
- 22,EXIT,
-
- 23,EXIT,
- n is an integer you can specify as the return code.
- 24,EXIT,
-
- 25,EXIT,
- variable
- 26,EXIT,
- is a user-defined or system variable, like SQL.SQLCODE.
- 27,EXIT,
- EXIT variable exits with the value of variable as the return code.
- 28,EXIT,
-
- 29,EXIT,
- EXIT enables you to specify an operating system return code so you can run
- 30,EXIT,
- SQL*Plus command files in batch mode and detect an unexpected event. The
- 31,EXIT,
- manner of detection is operating-system specific. SUCCESS, WARNING, and
- 32,EXIT,
- FAILURE represent operating system dependent values; on some systems,
- 33,EXIT,
- WARNING and FAILURE are not distinguishable. To exit conditionally, use
- 34,EXIT,
- WHENEVER SQLERROR.
- 35,EXIT,
-
- 36,EXIT,
-
- 37,EXIT,
- Example: The following returns the error code of the last executed SQL
- 38,EXIT,
- command or PL/SQL block:
- 39,EXIT,
-
- 40,EXIT,
- SQL> EXIT SQL.SQLCODE
- 41,EXIT,
-
- 42,EXIT,
- The location of the return code depends on your system.
- 43,EXIT,
-
- 44,EXIT,
-
- 45,EXIT,
- See also: connect, disconnect, host, quit, save, spool, SQLPlus,
- 46,EXIT,
- whenever sqlerror, commands, menu.
- 1,EXIT PL/SQL,
-
- 2,EXIT PL/SQL,
-
- 3,EXIT PL/SQL,
- EXIT PL/SQL
- 4,EXIT PL/SQL,
- PL/SQL statement
- 5,EXIT PL/SQL,
- EXIT label_name WHEN plsql_condition;
- 6,EXIT PL/SQL,
-
- 7,EXIT PL/SQL,
- Without label_name and WHEN clause, EXIT leaves the current loop.
- 8,EXIT PL/SQL,
- Use a label_name to exit an outer loop with that same label_name.
- 9,EXIT PL/SQL,
-
- 10,EXIT PL/SQL,
- If you use WHEN and specify a plsql_condition, an exit will occur
- 11,EXIT PL/SQL,
- whenever the condition evaluates to TRUE.
- 12,EXIT PL/SQL,
-
- 13,EXIT PL/SQL,
- When executed in a cursor FOR loop, EXIT also closes the cursor.
- 14,EXIT PL/SQL,
-
- 15,EXIT PL/SQL,
-
- 16,EXIT PL/SQL,
- See also: example where current of, loop, conditions, cursor for,
- 17,EXIT PL/SQL,
- cursors, commands, menu.
- 1,Error Handling,
-
- 2,Error Handling,
-
- 3,Error Handling,
- Error Handling
- 4,Error Handling,
-
- 5,Error Handling,
- Exceptions are internally-defined or user-defined error conditions.
- 6,Error Handling,
- In PL/SQL, you can specify what to do if an error condition occurs.
- 7,Error Handling,
-
- 8,Error Handling,
- You can define exceptions within a block's DECLARE section, then test
- 9,Error Handling,
- for exceptions in the block's body. If an exception exists, you execute
- 10,Error Handling,
- a RAISE statement, stopping normal execution of the block and passing
- 11,Error Handling,
- passing control to an exception handler in the block's EXCEPTION section.
- 12,Error Handling,
-
- 13,Error Handling,
-
- 14,Error Handling,
-
- 15,Error Handling,
- See also: declare, exception, pragma exception_init, raise,
- 16,Error Handling,
- pl/sql exceptions, error reporting (functions),
- 21,Error Handling,
- example error handling, blocks, commands, menu.
- 23,Error Handling,
-
- 24,Error Handling,
- See also: blocks, menu.
- 1,Error Reporting Functions,
-
- 2,Error Reporting Functions,
-
- 3,Error Reporting Functions,
- Error Reporting Functions
- 4,Error Reporting Functions,
-
- 5,Error Reporting Functions,
- SQLCODE returns the ORACLE error code of the internal exception that
- 6,Error Reporting Functions,
- passed control to an exception handler. Or, if the exception
- 7,Error Reporting Functions,
- is declared by the user within the current (or an enclosing)
- 8,Error Reporting Functions,
- block, SQLCODE returns +1. Outside an exception handler, it
- 9,Error Reporting Functions,
- returns 0. SQLCODE lets you identify exceptions in an OTHERS
- 10,Error Reporting Functions,
- handler.
- 11,Error Reporting Functions,
-
- 12,Error Reporting Functions,
- SQLERRM(error_code) returns the error message for the error_code you
- 13,Error Reporting Functions,
- specify. To have SQLERRM return the current SQLCODE value's
- 14,Error Reporting Functions,
- message, omit the error_code. Outside an exception handler,
- 15,Error Reporting Functions,
- SQLERRM gives the message "normal, successful completion".
- 16,Error Reporting Functions,
-
- 17,Error Reporting Functions,
- To use SQLCODE or SQLERRM in a SQL statement, assign it to a variable:
- 18,Error Reporting Functions,
- sql_code_num := SQLCODE
- 19,Error Reporting Functions,
-
- 20,Error Reporting Functions,
-
- 21,Error Reporting Functions,
-
- 22,Error Reporting Functions,
- More functions: 1 row char, 1 row number, conversion, date functions,
- 23,Error Reporting Functions,
- group, other functions.
- 24,Error Reporring Functions,
-
- 25,Error Reporting Functions,
- See also: error handling, variable, exception, commands, menu.
- 1,Example CONNECT BY,
-
- 2,Example CONNECT BY,
-
- 3,Example CONNECT BY,
- Example CONNECT BY
- 4,Example CONNECT BY,
-
- 5,Example CONNECT BY,
- To show an indented list of employees in manager/employee order,
- 6,Example CONNECT BY,
- use a tree-structured query:
- 7,Example CONNECT BY,
-
- 8,Example CONNECT BY,
- SELECT LPAD(' ', 2*LEVEL)||ename organization, level, empno, mgr
- 9,Example CONNECT BY,
- FROM emp
- 10,Example CONNECT BY,
- CONNECT BY PRIOR empno = mgr START WITH ename = 'KING';
- 11,Example CONNECT BY,
-
- 12,Example CONNECT BY,
- ORGANIZATION LEVEL EMPNO MGR
- 13,Example CONNECT BY,
- -------------------------------
- 14,Example CONNECT BY,
- KING 1 7839 (root node = KING)
- 15,Example CONNECT BY,
- JONES 2 7566 7839
- 16,Example CONNECT BY,
- SCOTT 3 7788 7566
- 17,Example CONNECT BY,
- ADAMS 4 7876 7788
- 18,Example CONNECT BY,
- FORD 3 7902 7566
- 19,Example CONNECT BY,
- SMITH 4 7369 7902
- 20,Example CONNECT BY,
- BLAKE 2 7698 7839
- 21,Example CONNECT BY,
- ALLEN 3 7499 7698
- 22,Example CONNECT BY,
- WARD 3 7521 7698
- 23,Example CONNECT BY,
-
- 24,Example CONNECT BY,
- See also: connect by, tree-structured query, select, menu.
- 1,Example CURSOR FOR,
-
- 2,Example CURSOR FOR,
-
- 3,Example CURSOR FOR,
- Example CURSOR FOR
- 4,Example CURSOR FOR,
-
- 5,Example CURSOR FOR,
- DECLARE
- 6,Example CURSOR FOR,
- CURSOR emp_cursor(dnum NUMBER) IS Computes total wages
- 7,Example CURSOR FOR,
- SELECT sal, comm FROM emp WHERE deptno=dnum; (sal + comm) paid to
- 8,Example CURSOR FOR,
- total_wages NUMBER(11,2) := 0; employees in dept.20
- 9,Example CURSOR FOR,
- high_paid NUMBER(4) := 0; and how many receive
- 10,Example CURSOR FOR,
- BEGIN a salary over $2000.
- 11,Example CURSOR FOR,
- FOR emp_record IN emp_cursor(20) LOOP
- 12,Example CURSOR FOR,
- emp_record.comm := NVL(emp_record.comm, 0);
- 13,Example CURSOR FOR,
- total_wages := total_wages + emp_record.sal + emp_record.comm;
- 14,Example CURSOR FOR,
- IF emp_record.sal > 2000.00 THEN high_paid := high_paid + 1;
- 15,Example CURSOR FOR,
- END IF;
- 16,Example CURSOR FOR,
- END LOOP;
- 17,Example CURSOR FOR,
- INSERT INTO temp VALUES (high_paid, higher_comm,
- 18,Example CURSOR FOR,
- 'Total Wages: ' || TO_CHAR(total_wages));
- 19,Example CURSOR FOR,
- COMMIT;
- 20,Example CURSOR FOR,
- END;
- 21,Example CURSOR FOR,
-
- 22,Example CURSOR FOR,
-
- 23,Example CURSOR FOR,
- See also: cursor for, cursors, declare, loop, if, insert, examples, menu.
- 1,Example Conversion,
-
- 2,Example Conversion,
-
- 3,Example Conversion,
- Example Conversion (Functions)
- 4,Example Conversion,
-
- 5,Example Conversion,
- To compute the number of days remaining in 1989 (on 5/31/89):
- 6,Example Conversion,
-
- 7,Example Conversion,
- SELECT SYSDATE, TO_DATE('01-JAN-90') - ROUND(SYSDATE) days_left
- 8,Example Conversion,
- FROM dummy;
- 9,Example Conversion,
- SYSDATE DAYS_LEFT
- 10,Example Conversion,
- --------------------
- 11,Example Conversion,
- 31-May-89 214
- 12,Example Conversion,
-
- 13,Example Conversion,
-
- 14,Example Conversion,
- To count the employees hired each year:
- 15,Example Conversion,
- HIRED COUNT(*)
- 16,Example Conversion,
- SELECT TO_CHAR(hiredate, 'YYYY') hired, COUNT(*) --------------
- 17,Example Conversion,
- FROM emp 1986 1
- 18,Example Conversion,
- GROUP BY TO_CHAR(hiredate, 'YYYY'); 1987 10
- 19,Example Conversion,
- 1988 1
- 20,Example Conversion,
- 1989 2
- 21,Example Conversion,
-
- 22,Example Conversion,
-
- 23,Example Conversion,
- See also: conversion (functions), select, group by, examples, menu.
- 1,Example Correlated Subquery,
-
- 2,Example Correlated Subquery,
-
- 3,Example Correlated Subquery,
- Example Correlated Subquery
- 4,Example Correlated Subquery,
-
- 5,Example Correlated Subquery,
- This correlated subquery displays all employees whose salary is
- 6,Example Correlated Subquery,
- greater than the average salary of their own department.
- 7,Example Correlated Subquery,
-
- 8,Example Correlated Subquery,
- SELECT ename, deptno, sal DEPTNO ENAME SAL
- 9,Example Correlated Subquery,
- FROM emp emp_twin ------------------
- 10,Example Correlated Subquery,
- WHERE sal > (SELECT AVG(sal) 10 KING 5000
- 11,Example Correlated Subquery,
- FROM emp 20 JONES 2975
- 12,Example Correlated Subquery,
- WHERE emp.deptno = emp_twin.deptno) 20 SCOTT 3000
- 13,Example Correlated Subquery,
- ORDER BY deptno; 20 FORD 3000
- 14,Example Correlated Subquery,
-
- 15,Example Correlated Subquery,
-
- 16,Example Correlated Subquery,
- The ROWID with DELETE example shows another correlated subquery.
- 17,Example Correlated Subquery,
-
- 18,Example Correlated Subquery,
-
- 19,Example Correlated Subquery,
- See also: correlated subquery, select, example delete, examples,
- 20,Example Correlated Subquery,
- menu.
- 1,Example Cursors,
-
- 2,Example Cursors,
-
- 3,Example Cursors,
- Example Cursors
- 4,Example Cursors,
-
- 5,Example Cursors,
- DECLARE Returns the five highest paid
- 6,Example Cursors,
- CURSOR c1 IS employees from the emp table,
- 7,Example Cursors,
- SELECT ename, sal FROM emp and stores the result in tmp,
- 8,Example Cursors,
- ORDER BY sal DESC; a table created for transfer.
- 9,Example Cursors,
- name emp.ename%TYPE;
- 10,Example Cursors,
- salary emp.sal%TYPE; Output: SELECT * FROM tmp
- 11,Example Cursors,
- BEGIN ORDER BY earns DESC;
- 12,Example Cursors,
- OPEN c1;
- 13,Example Cursors,
- FOR i IN 1..5 LOOP EMPLOYEE EARNS
- 14,Example Cursors,
- FETCH c1 INTO name, salary; --------------------
- 15,Example Cursors,
- EXIT WHEN c1%NOTFOUND; KING 5000
- 16,Example Cursors,
- INSERT INTO tmp VALUES(name, salary); SCOTT 3000
- 17,Example Cursors,
- COMMIT; FORD 3000
- 18,Example Cursors,
- END LOOP; JONES 2975
- 19,Example Cursors,
- CLOSE c1; BLAKE 2850
- 20,Example Cursors,
- END;
- 21,Example Cursors,
-
- 22,Example Cursors,
-
- 23,Example Cursors,
- See also: cursors, declare, open, loop, fetch, exit plsql, insert,
- 24,Example Cursors,
- commit, close, examples, menu.
- 1,Example DELETE,
-
- 2,Example DELETE,
-
- 3,Example DELETE,
- Example DELETE
- 4,Example DELETE,
-
- 5,Example DELETE,
- This statement uses ROWID within a correlated subquery to eliminate
- 6,Example DELETE,
- any duplicate rows in the dept table:
- 7,Example DELETE,
-
- 8,Example DELETE,
-
- 9,Example DELETE,
- DELETE FROM dept x WHERE ROWID > (SELECT MIN(ROWID)
- 10,Example DELETE,
- FROM dept y
- 11,Example DELETE,
- WHERE x.deptno = y.deptno
- 12,Example DELETE,
- AND x.dname = y.dname
- 13,Example DELETE,
- AND x.loc = y.loc);
- 14,Example DELETE,
-
- 15,Example DELETE,
-
- 16,Example DELETE,
-
- 17,Example DELETE,
- For an example of a correlated subquery in a SELECT statement, see
- 18,Example DELETE,
- example correlated subquery.
- 19,Example DELETE,
-
- 20,Example DELETE,
- See also: rowid, correlated subquery, delete, examples, menu.
- 1,Example Datatype,
-
- 2,Example Datatype,
-
- 3,Example Datatype,
- Example Datatype
- 4,Example Datatype,
-
- 5,Example Datatype,
- From a script file for building example tables:
- 6,Example Datatype,
-
- 7,Example Datatype,
- DROP TABLE accounts;
- 8,Example Datatype,
- CREATE TABLE accounts(
- 9,Example Datatype,
- account_id NUMBER(4) NOT NULL, --up to 4 digits; cannot be null
- 10,Example Datatype,
- bal NUMBER(11, 2)); --up to 11 digits, 2 of which
- 11,Example Datatype,
- DROP TABLE action; are after the decimal point
- 12,Example Datatype,
- CREATE TABLE action(
- 13,Example Datatype,
- account_id NUMBER(4) NOT NULL,
- 14,Example Datatype,
- oper_type CHAR(1) NOT NULL, --must be one character
- 15,Example Datatype,
- new_value NUMBER(11, 2),
- 16,Example Datatype,
- status CHAR(45),
- 17,Example Datatype,
- time_tag DATE NOT NULL); --must be a date; cannot be null
- 18,Example Datatype,
- ...
- 19,Example Datatype,
-
- 20,Example Datatype,
-
- 21,Example Datatype,
- See also: variables, number, char, date, create table, drop table,
- 22,Example Datatype,
- nulls, examples, menu.
- 1,Example Date Functions,
-
- 2,Example Date Functions,
-
- 3,Example Date Functions,
- Example Date Functions
- 4,Example Date Functions,
-
- 5,Example Date Functions,
- Use a date functions calculation to list employees hired since 1982:
- 6,Example Date Functions,
-
- 7,Example Date Functions,
- SELECT ename, hiredate ENAME HIREDATE
- 8,Example Date Functions,
- FROM emp ------------------
- 9,Example Date Functions,
- WHERE hiredate BETWEEN '1-JAN-82' AND SYSDATE MILLER 23-JAN-89
- 10,Example Date Functions,
- ORDER BY hiredate; SCOTT 05-JAN-89
- 11,Example Date Functions,
- WARD 08-JAN-89
- 12,Example Date Functions,
- . . .
- 13,Example Date Functions,
- To list each employee's first review date:
- 14,Example Date Functions,
-
- 15,Example Date Functions,
- SELECT ename, hiredate, ENAME HIREDATE REVIEW_1
- 16,Example Date Functions,
- ADD_MONTHS(hiredate, 6) "1st Rev" ----------------------------
- 17,Example Date Functions,
- FROM emp ADAMS 12-JAN-83 12-JUL-83
- 18,Example Date Functions,
- ORDER BY ename; ALLEN 20-FEB-81 20-AUG-81
- 19,Example Date Functions,
- BLAKE 01-MAY-81 01-NOV-81
- 20,Example Date Functions,
- "1st Rev" is a column alias. . . .
- 21,Example Date Functions,
-
- 22,Example Date Functions,
-
- 23,Example Date Functions,
- See also: date functions, select, alias, examples, menu.
- 1,Example Error Handling,
-
- 2,Example Error Handling,
-
- 3,Example Error Handling,
- Example Error Handling
- 4,Example Error Handling,
-
- 5,Example Error Handling,
- DECLARE
- 6,Example Error Handling,
- bad_employee_num EXCEPTION; --user-defined
- 7,Example Error Handling,
- bad_acct_num EXCEPTION; --user-defined
- 8,Example Error Handling,
- . . . --other declarations
- 9,Example Error Handling,
- BEGIN
- 10,Example Error Handling,
- . . . --PL/SQL statements
- 11,Example Error Handling,
- EXCEPTION
- 12,Example Error Handling,
- WHEN bad_employee_num OR bad_acct_num THEN ROLLBACK;
- 13,Example Error Handling,
- WHEN ZERO_DIVIDE THEN --a PL/SQL exception
- 14,Example Error Handling,
- INSERT INTO inventory_table VALUES (product_name, quantity);
- 15,Example Error Handling,
- COMMIT;
- 16,Example Error Handling,
- END;
- 17,Example Error Handling,
-
- 18,Example Error Handling,
-
- 19,Example Error Handling,
- See also: error handling, declare, exception, pl/sql exceptions,
- 20,Example Error Handling,
- rollback, insert, commit, examples, menu.
- 1,Example GROUP BY,
-
- 2,Example GROUP BY,
-
- 3,Example GROUP BY,
- Example GROUP BY
- 4,Example GROUP BY,
-
- 5,Example GROUP BY,
- To display the minimum and maximum salaries of clerks for each of
- 6,Example GROUP BY,
- the departments in the emp table:
- 7,Example GROUP BY,
- DEPTNO MIN(SAL) MAX(SAL)
- 8,Example GROUP BY,
- SELECT deptno, MIN(sal), MAX(sal) --------------------------
- 9,Example GROUP BY,
- FROM emp WHERE job = 'CLERK' 10 1300 1300
- 10,Example GROUP BY,
- GROUP BY deptno; 20 800 1100
- 11,Example GROUP BY,
- 30 950 950
- 12,Example GROUP BY,
-
- 13,Example GROUP BY,
- To limit the query to departments
- 14,Example GROUP BY,
- whose lowest salary is under 1000:
- 15,Example GROUP BY,
- DEPTNO MIN(SAL) MAX(SAL)
- 16,Example GROUP BY,
- SELECT deptno, MIN(sal), MAX(sal) --------------------------
- 17,Example GROUP BY,
- FROM emp WHERE job = 'CLERK' 20 800 1100
- 18,Example GROUP BY,
- GROUP BY deptno 30 950 950
- 19,Example GROUP BY,
- HAVING MIN(sal) < 1000;
- 20,Example GROUP BY,
-
- 21,Example GROUP BY,
-
- 22,Example GROUP BY,
-
- 23,Example GROUP BY,
- See also: group by, group functions, select, examples, menu.
- 1,Example Group Functions,
-
- 2,Example Group Functions,
-
- 3,Example Group Functions,
- Example Group Functions
- 4,Example Group Functions,
-
- 5,Example Group Functions,
- Here are some of the ways group functions can be used in queries:
- 6,Example Group Functions,
-
- 7,Example Group Functions,
- SELECT 12 * AVG(sal) Finds average 12*AVG(sal)
- 8,Example Group Functions,
- FROM emp yearly pay of ------------
- 9,Example Group Functions,
- WHERE job = 'CLERK'; clerks. 12450
- 10,Example Group Functions,
-
- 11,Example Group Functions,
-
- 12,Example Group Functions,
- SELECT COUNT(comm) eligible Counts those who ELIGIBLE
- 13,Example Group Functions,
- FROM emp; are eligible for --------
- 14,Example Group Functions,
- a commission. 4
- 15,Example Group Functions,
-
- 16,Example Group Functions,
- SELECT COUNT(*) Counts employees COUNT(*)
- 17,Example Group Functions,
- FROM emp in Department 20. --------
- 18,Example Group Functions,
- WHERE deptno = 20; COUNT(*) tallies 5
- 19,Example Group Functions,
- rows meeting the
- 20,Example Group Functions,
- WHERE condition.
- 21,Example Group Functions,
-
- 22,Example Group Functions,
-
- 23,Example Group Functions,
- See also: group functions, query, select, where, examples, menu.
- 1,Example INSERT,
-
- 2,Example INSERT,
-
- 3,Example INSERT,
- Example INSERT
- 4,Example INSERT,
-
- 5,Example INSERT,
- To add a new employee to the emp table:
- 6,Example INSERT,
-
- 7,Example INSERT,
- INSERT INTO emp(empno, ename, job, mgr, hiredate, sal, comm, deptno)
- 8,Example INSERT,
- VALUES(7979, 'POWERS', 'ANALYST', 7839, '1-JUN-89', 3600, NULL, 10);
- 9,Example INSERT,
-
- 10,Example INSERT,
-
- 11,Example INSERT,
- To insert information from another table, replace the VALUES list
- 12,Example INSERT,
- with a subquery:
- 13,Example INSERT,
-
- 14,Example INSERT,
- INSERT INTO bonus (ename, job, sal, comm)
- 15,Example INSERT,
- SELECT ename, job, sal, comm
- 16,Example INSERT,
- FROM emp
- 17,Example INSERT,
- WHERE ename = 'KING';
- 18,Example INSERT,
-
- 19,Example INSERT,
-
- 20,Example INSERT,
-
- 21,Example INSERT,
- See also: insert, subquery, select, examples, menu.
- 1,Example LIKE,
-
- 2,Example LIKE,
-
- 3,Example LIKE,
- Example LIKE
- 4,Example LIKE,
-
- 5,Example LIKE,
- To find employees who have hyphenated names:
- 6,Example LIKE,
-
- 7,Example LIKE,
- SELECT ename
- 8,Example LIKE,
- FROM emp
- 9,Example LIKE,
- WHERE ename LIKE '%-%'
- 10,Example LIKE,
- ORDER BY ename;
- 11,Example LIKE,
-
- 12,Example LIKE,
-
- 13,Example LIKE,
- To find employees who have names beginning with 'M':
- 14,Example LIKE,
-
- 15,Example LIKE,
- SELECT ename, job, deptno
- 16,Example LIKE,
- FROM emp
- 17,Example LIKE,
- WHERE ename LIKE 'M%';
- 18,Example LIKE,
-
- 19,Example LIKE,
-
- 20,Example LIKE,
- See also: like, select, order by, examples, menu.
- 1,Example LOCK TABLE,
-
- 2,Example LOCK TABLE,
-
- 3,Example LOCK TABLE,
- Example LOCK TABLE
- 4,Example LOCK TABLE,
-
- 5,Example LOCK TABLE,
- This statement prohibits any activity except queries on the emp table;
- 6,Example LOCK TABLE,
- NOWAIT returns control if the table is already locked by another user:
- 7,Example LOCK TABLE,
-
- 8,Example LOCK TABLE,
- LOCK TABLE emp IN EXCLUSIVE MODE NOWAIT;
- 9,Example LOCK TABLE,
- rest_of_transaction
- 10,Example LOCK TABLE,
- COMMIT;
- 11,Example LOCK TABLE,
-
- 12,Example LOCK TABLE,
-
- 13,Example LOCK TABLE,
- The following statement locks the accounts table in share mode, which
- 14,Example LOCK TABLE,
- permits queries, but prohibits inserts, updates, and deletes:
- 15,Example LOCK TABLE,
-
- 16,Example LOCK TABLE,
- LOCK TABLE accounts IN SHARE MODE;
- 17,Example LOCK TABLE,
- rest_of_transaction
- 18,Example LOCK TABLE,
- COMMIT;
- 19,Example LOCK TABLE,
-
- 20,Example LOCK TABLE,
-
- 21,Example LOCK TABLE,
- See also: lock table, query, commit, examples, menu.
- 1,Example NEXTVAL,
-
- 2,Example NEXTVAL,
-
- 3,Example NEXTVAL,
- Example NEXTVAL
- 4,Example NEXTVAL,
-
- 5,Example NEXTVAL,
- Suppose a sequence named custnoseq is defined:
- 6,Example NEXTVAL,
-
- 7,Example NEXTVAL,
- CREATE SEQUENCE custnoseq INCREMENT BY 10;
- 8,Example NEXTVAL,
-
- 9,Example NEXTVAL,
- If there is a customer table with columns custno, fname, and lname,
- 10,Example NEXTVAL,
- custnoseq.NEXTVAL is used with INSERT to assign a new, unique custno
- 11,Example NEXTVAL,
- for Stanley Daleson. The client number will be equal to the previous
- 12,Example NEXTVAL,
- highest client number plus 10:
- 13,Example NEXTVAL,
-
- 14,Example NEXTVAL,
- INSERT INTO cust VALUES (custnoseq.NEXTVAL, 'Stanley', 'Daleson');
- 15,Example NEXTVAL,
-
- 16,Example NEXTVAL,
- Assuming a table named custbal with columns custno and bal, execute
- 17,Example NEXTVAL,
- this statement next to insert a new row with an outstanding balance
- 18,Example NEXTVAL,
- and the same custno just added to the customers table:
- 19,Example NEXTVAL,
-
- 20,Example NEXTVAL,
- INSERT INTO custbal VALUES (custnoseq.CURRVAL, 144.12);
- 21,Example NEXTVAL,
-
- 22,Example NEXTVAL,
-
- 23,Example NEXTVAL,
- See also: nextval, insert, sequences, pseudo-columns, examples, menu.
- 1,Example Nulls,
-
- 2,Example Nulls,
-
- 3,Example Nulls,
- Example Nulls
- 4,Example Nulls,
-
- 5,Example Nulls,
- The comm column has a value of null for any employee ineligible for
- 6,Example Nulls,
- a commission. To see only employees eligible for commissions:
- 7,Example Nulls,
-
- 8,Example Nulls,
- SELECT ename, comm, sal, deptno ENAME COMM SAL DEPTNO
- 9,Example Nulls,
- FROM emp --------------------------
- 10,Example Nulls,
- WHERE comm IS NOT NULL MARTIN 1400 1250 30
- 11,Example Nulls,
- ORDER BY comm DESC; WARD 500 1250 30
- 12,Example Nulls,
- ALLEN 300 1600 30
- 13,Example Nulls,
- TURNER 0 1500 30
- 14,Example Nulls,
-
- 15,Example Nulls,
- Use IS NOT or IS; using <> or = with NULL always evaluates to FALSE.
- 16,Example Nulls,
-
- 17,Example Nulls,
- Two adjacent apostrophes (0 length CHAR value) set a column to null:
- 18,Example Nulls,
-
- 19,Example Nulls,
- INSERT INTO emp VALUES (8905, 'POST', '', 7698,...);
- 20,Example Nulls,
-
- 21,Example Nulls,
-
- 22,Example Nulls,
- See also: nulls, select, insert, examples, menu.
- 1,Example Numeric FOR,
-
- 2,Example Numeric FOR,
-
- 3,Example Numeric FOR,
- Example Numeric FOR
- 4,Example Numeric FOR,
-
- 5,Example Numeric FOR,
- DECLARE
- 6,Example Numeric FOR,
- x NUMBER := 100;
- 7,Example Numeric FOR,
- BEGIN
- 8,Example Numeric FOR,
- FOR i in 1..4 LOOP
- 9,Example Numeric FOR,
- IF MOD(i/2) = 0 THEN --i is even
- 10,Example Numeric FOR,
- INSERT INTO temp VALUES (i, x, 'an even index');
- 11,Example Numeric FOR,
- ELSE
- 12,Example Numeric FOR,
- INSERT INTO temp VALUES (i, x, 'an odd index');
- 13,Example Numeric FOR,
- END IF;
- 14,Example Numeric FOR,
- x := x + 25;
- 15,Example Numeric FOR,
- END LOOP;
- 16,Example Numeric FOR,
- COMMIT; COL1 COL2 MESSAGE
- 17,Example Numeric FOR,
- END; ----------------------------
- 18,Example Numeric FOR,
- 1 100 an odd index
- 19,Example Numeric FOR,
- SQL> SELECT * FROM temp 2 125 an even index
- 20,Example Numeric FOR,
- ORDER BY col1; 3 150 an odd index
- 21,Example Numeric FOR,
- 4 175 an even index
- 22,Example Numeric FOR,
-
- 23,Example Numeric FOR,
-
- 24,Example Numeric FOR,
- See also: numeric for, number, if, insert, examples, menu.
- 1,Example Outer Join,
-
- 2,Example Outer Join,
-
- 3,Example Outer Join,
- Example Outer Join
- 4,Example Outer Join,
-
- 5,Example Outer Join,
- To join tables EMP and DEPT (an outer join) and list departments 30
- 6,Example Outer Join,
- and 40, with or without employees:
- 7,Example Outer Join,
- ENAME DEPTNO DNAME
- 8,Example Outer Join,
- --------------------------
- 9,Example Outer Join,
- SELECT ename, deptno, dname OPERATIONS
- 10,Example Outer Join,
- FROM emp, dept ALLEN 30 SALES
- 11,Example Outer Join,
- WHERE dept.deptno = emp.deptno (+) BLAKE 30 SALES
- 12,Example Outer Join,
- AND dept.deptno IN (30, 40) JAMES 30 SALES
- 13,Example Outer Join,
- ORDER BY ename; MARTIN 30 SALES
- 14,Example Outer Join,
- TURNER 30 SALES
- 15,Example Outer Join,
- WARD 30 SALES
- 16,Example Outer Join,
-
- 17,Example Outer Join,
-
- 18,Example Outer Join,
-
- 19,Example Outer Join,
- See also: outer join, join, select, examples, menu.
- 1,Example Query,
-
- 2,Example Query,
-
- 3,Example Query,
- Example Query
- 4,Example Query,
-
- 5,Example Query,
- Find managers SELECT ename, sal, job ENAME SAL JOB
- 6,Example Query,
- and employees FROM emp -------------------------
- 7,Example Query,
- with a salary WHERE job = 'MANAGER' KING 5000 PRESIDENT
- 8,Example Query,
- $5000 or more; OR sal >= 5000 JONES 2975 MANAGER
- 9,Example Query,
- show in order ORDER BY sal DESC; BLAKE 2850 MANAGER
- 10,Example Query,
- of salary in CLARK 2450 MANAGER
- 11,Example Query,
- query results.
- 12,Example Query,
-
- 13,Example Query,
-
- 14,Example Query,
- List names and SELECT ename, job, deptno ENAME JOB DEPTNO
- 15,Example Query,
- departments of FROM emp -------------------------
- 16,Example Query,
- employees who WHERE job IN ('ANALYST', ADAMS CLERK 20
- 17,Example Query,
- are analysts, 'CLERK', 'PRESIDENT') FORD ANALYST 20
- 18,Example Query,
- clerks, or the ORDER BY ename; JAMES CLERK 20
- 19,Example Query,
- president. KING PRESIDENT 10
- 20,Example Query,
- ...
- 21,Example Query,
-
- 22,Example Query,
-
- 23,Example Query,
- See also: query, select, from, examples, menu.
- 1,Example ROLLBACK,
-
- 2,Example ROLLBACK,
-
- 3,Example ROLLBACK,
- Example ROLLBACK
- 4,Example ROLLBACK,
-
- 5,Example ROLLBACK,
- In updating salaries, you can include a number of savepoints, each
- 6,Example ROLLBACK,
- with a unique name. To discard changes made to the database since
- 7,Example ROLLBACK,
- a particular savepoint, issue a ROLLBACK statement that references
- 8,Example ROLLBACK,
- the name of that SAVEPOINT:
- 9,Example ROLLBACK,
-
- 10,Example ROLLBACK,
- UPDATE emp SET sal = 2000 WHERE ename = 'BLAKE';
- 11,Example ROLLBACK,
- SAVEPOINT blakesal;
- 12,Example ROLLBACK,
- UPDATE emp SET sal = 1500 WHERE ename = 'CLARK';
- 13,Example ROLLBACK,
- SELECT SUM(sal) FROM emp;
- 14,Example ROLLBACK,
- ROLLBACK TO SAVEPOINT blakesal; --undoes change to Clark's sal
- 15,Example ROLLBACK,
- COMMIT;
- 16,Example ROLLBACK,
-
- 17,Example ROLLBACK,
-
- 18,Example ROLLBACK,
- See also: rollback, savepoint, update, commit, examples, menu.
- 1,Example SELECT INTO,
-
- 2,Example SELECT INTO,
-
- 3,Example SELECT INTO,
- Example SELECT INTO
- 4,Example SELECT INTO,
-
- 5,Example SELECT INTO,
- DECLARE
- 6,Example SELECT INTO,
- dept_rec dept%ROWTYPE;
- 7,Example SELECT INTO,
- name emp.ename%TYPE;
- 8,Example SELECT INTO,
- job_title empjob%TYPE;
- 9,Example SELECT INTO,
- wages emp.sal%TYPE;
- 10,Example SELECT INTO,
- BEGIN
- 11,Example SELECT INTO,
- SELECT * INTO dept_rec
- 12,Example SELECT INTO,
- FROM dept
- 13,Example SELECT INTO,
- WHERE deptno = 20;
- 14,Example SELECT INTO,
- SELECT ename, job, sal INTO name, job_title, wages
- 15,Example SELECT INTO,
- FROM emp
- 16,Example SELECT INTO,
- WHERE empno = 1440;
- 17,Example SELECT INTO,
- ... --rest of block
- 18,Example SELECT INTO,
- END;
- 19,Example SELECT INTO,
-
- 20,Example SELECT INTO,
-
- 21,Example SELECT INTO,
- See also: select into, attributes (%ROWTYPE, %TYPE), examples, menu.
- 1,Example SELECT List,
-
- 2,Example SELECT List,
-
- 3,Example SELECT List,
- Example SELECT List
- 4,Example SELECT List,
-
- 5,Example SELECT List,
- The SELECT list may contain...
- 6,Example SELECT List,
-
- 7,Example SELECT List,
-
- 8,Example SELECT List,
- - Column names and aliases: SELECT ename, deptno no, dname dept
- 9,Example SELECT List,
- FROM emp...
- 10,Example SELECT List,
-
- 11,Example SELECT List,
-
- 12,Example SELECT List,
- - Group functions: SELECT 12 * AVG(sal + comm)
- 13,Example SELECT List,
- FROM emp
- 14,Example SELECT List,
- WHERE job = 'SALESMAN'
- 15,Example SELECT List,
-
- 16,Example SELECT List,
-
- 17,Example SELECT List,
- - Non-Group functions: SELECT TO_CHAR(hiredate, 'YYYY'),
- 18,Example SELECT List,
- INITCAP(ename), sal
- 19,Example SELECT List,
- FROM emp...
- 20,Example SELECT List,
-
- 21,Example SELECT List,
-
- 22,Example SELECT List,
- See also: select list, alias, select, group functions, examples, menu.
- 1,Example SET TRANSACTION,
-
- 2,Example SET TRANSACTION,
-
- 3,Example SET TRANSACTION,
- Example SET TRANSACTION
- 4,Example SET TRANSACTION,
-
- 5,Example SET TRANSACTION,
- A company runs the following statements at the end of each month to
- 6,Example SET TRANSACTION,
- inventory the number of ships and containers it owns:
- 7,Example SET TRANSACTION,
-
- 8,Example SET TRANSACTION,
- COMMIT;
- 9,Example SET TRANSACTION,
- SET TRANSACTION READ ONLY;
- 10,Example SET TRANSACTION,
- SELECT COUNT(*) FROM ship;
- 11,Example SET TRANSACTION,
- SELECT COUNT(*) FROM container;
- 12,Example SET TRANSACTION,
- COMMIT;
- 13,Example SET TRANSACTION,
-
- 14,Example SET TRANSACTION,
- The last COMMIT is used to end the read-only transaction; there are
- 15,Example SET TRANSACTION,
- no changes to the database to make permanent.
- 16,Example SET TRANSACTION,
-
- 17,Example SET TRANSACTION,
- Every SELECT in a read-only transaction refers to the same snapshot
- 18,Example SET TRANSACTION,
- of the database, giving a multi-table, multi-query, read-consistent
- 19,Example SET TRANSACTION,
- view.
- 20,Example SET TRANSACTION,
-
- 21,Example SET TRANSACTION,
-
- 22,Example SET TRANSACTION,
- See also: set transaction, group functions, commit, examples, menu.
- 1,Example Set Operators,
-
- 2,Example Set Operators,
-
- 3,Example Set Operators,
- Example Set Operators
- 4,Example Set Operators,
-
- 5,Example Set Operators,
- If you have three tables like emp, and want to list an emp employee
- 6,Example Set Operators,
- with the same salary as Scott in Belmont, Jones in Chicago, or Smith
- 7,Example Set Operators,
- in New York:
- 8,Example Set Operators,
- SELECT ename, job, sal
- 9,Example Set Operators,
- FROM emp
- 10,Example Set Operators,
- WHERE sal IN
- 11,Example Set Operators,
- (SELECT sal
- 12,Example Set Operators,
- FROM belmont
- 13,Example Set Operators,
- WHERE ename = 'SCOTT'
- 14,Example Set Operators,
- UNION
- 15,Example Set Operators,
- SELECT sal
- 16,Example Set Operators,
- FROM chicago
- 17,Example Set Operators,
- WHERE ename = 'JONES'
- 18,Example Set Operators,
- UNION
- 19,Example Set Operators,
- SELECT sal
- 20,Example Set Operators,
- FROM new_york
- 21,Example Set Operators,
- WHERE ename = 'SMITH');
- 22,Example Set Operators,
-
- 23,Example Set Operators,
- A query with the set operators UNION, INTERSECT, or MINUS must select
- 24,Example Set Operators,
- the same number of columns, and corresponding columns must have the
- 25,Example Set Operators,
- same datatype.
- 26,Example Set Operators,
-
- 27,Example Set Operators,
- See also: set operators, select, query, examples, menu.
- 1,Example Simple Join,
-
- 2,Example Simple Join,
-
- 3,Example Simple Join,
- Example Simple Join
- 4,Example Simple Join,
-
- 5,Example Simple Join,
- To list with salary, department, and location each employees who earns
- 6,Example Simple Join,
- $3000 or more per month, use a simple join:
- 7,Example Simple Join,
-
- 8,Example Simple Join,
- SELECT ename, sal, dname, loc ENAME SAL DNAME LOC
- 9,Example Simple Join,
- FROM emp, dept ----------------------------------
- 10,Example Simple Join,
- WHERE emp.deptno = dept.deptno KING 5000 ACCOUNTING NEW YORK
- 11,Example Simple Join,
- AND sal >= 3000; SCOTT 3000 RESEARCH DALLAS
- 12,Example Simple Join,
- FORD 3000 RESEARCH DALLAS
- 13,Example Simple Join,
-
- 14,Example Simple Join,
-
- 15,Example Simple Join,
- To find each employee's salary grade:
- 16,Example Simple Join,
- ENAME JOB GRADE SAL
- 17,Example Simple Join,
- SELECT ename, job, grade, sal ---------------------------
- 18,Example Simple Join,
- FROM emp, salgrade ADAMS CLERK 1 1100
- 19,Example Simple Join,
- WHERE sal BETWEEN losal AND hisal ALLEN SALESMAN 3 1600
- 20,Example Simple Join,
- ORDER BY ename BLAKE MANAGER 4 2850
- 21,Example Simple Join,
- CLARK MANAGER 4 2450
- 22,Example Simple Join,
-
- 23,Example Simple Join,
- See also: simple join, select, examples, menu.
- 1,Example Subquery,
-
- 2,Example Subquery,
-
- 3,Example Subquery,
- Example Subquery
- 4,Example Subquery,
-
- 5,Example Subquery,
- This subquery gives each MANAGER in the DALLAS office a salary equal
- 6,Example Subquery,
- to the company's highest paid employee:
- 7,Example Subquery,
-
- 8,Example Subquery,
- UPDATE emp
- 9,Example Subquery,
- SET sal = (SELECT MAX(sal) FROM emp)
- 10,Example Subquery,
- WHERE JOB = 'MANAGER'
- 11,Example Subquery,
- AND DEPTNO IN (SELECT deptno FROM dept WHERE loc = 'DALLAS');
- 12,Example Subquery,
-
- 13,Example Subquery,
- Use = to equate a field with a subquery if the subquery returns only
- 14,Example Subquery,
- one value; use IN instead of = if a subquery returns multiple values.
- 15,Example Subquery,
-
- 16,Example Subquery,
- To list employees who got a bonus without changing jobs:
- 17,Example Subquery,
-
- 18,Example Subquery,
- SELECT empno, ename
- 19,Example Subquery,
- FROM emp
- 20,Example Subquery,
- WHERE (job, ename) = (SELECT job, ename FROM bonus);
- 21,Example Subquery,
-
- 22,Example Subquery,
-
- 23,Example Subquery,
- See also: subquery, update, select, where, comparison, examples, menu.
- 1,Example WHERE CURRENT OF,
-
- 2,Example WHERE CURRENT OF,
-
- 3,Example WHERE CURRENT OF,
- Example WHERE CURRENT OF
- 4,Example WHERE CURRENT OF,
-
- 5,Example WHERE CURRENT OF,
- This PL/SQL code does the actions listed in a table called today,
- 6,Example WHERE CURRENT OF,
- setting status to DONE for actions completed; for example, actions
- 7,Example WHERE CURRENT OF,
- to be taken on a table of account balances at the end of the day.
- 8,Example WHERE CURRENT OF,
-
- 9,Example WHERE CURRENT OF,
- DECLARE
- 10,Example WHERE CURRENT OF,
- CURSOR c1 IS SELECT action, acct FROM today
- 11,Example WHERE CURRENT OF,
- FOR UPDATE OF status;
- 12,Example WHERE CURRENT OF,
- the_action today.act%TYPE;
- 13,Example WHERE CURRENT OF,
- acct_num today.acct%TYPE;
- 14,Example WHERE CURRENT OF,
- BEGIN
- 15,Example WHERE CURRENT OF,
- OPEN c1;
- 16,Example WHERE CURRENT OF,
- LOOP
- 17,Example WHERE CURRENT OF,
- FETCH c1 INTO the_action, acct_num;
- 18,Example WHERE CURRENT OF,
- EXIT WHEN c1%NOTFOUND;
- 19,Example WHERE CURRENT OF,
- ... --statements to perform actions
- 20,Example WHERE CURRENT OF,
- UPDATE today SET status = 'done'
- 21,Example WHERE CURRENT OF,
- WHERE CURRENT OF c1;
- 22,Example WHERE CURRENT OF,
- END LOOP;
- 23,Example WHERE CURRENT OF,
- CLOSE c1;
- 24,Example WHERE CURRENT OF,
- COMMIT;
- 25,Example WHERE CURRENT OF,
- END;
- 26,Example WHERE CURRENT OF,
-
- 27,Example WHERE CURRENT OF,
- See also: where current of, cursors, declare, for update of, open, loop,
- 28,Example WHERE CURRENT OF,
- fetch, exit plsql, update, examples, menu.
- 1,Example WHILE,
-
- 2,Example WHILE,
-
- 3,Example WHILE,
- Example WHILE
- 4,Example WHILE,
-
- 5,Example WHILE,
- Suppose you now have over $50,000 to spend on employee salaries, and
- 6,Example WHILE,
- wish to increase everyone's salary proportionally. Use this loop to
- 7,Example WHILE,
- increase each person's salary by 10% until the total of all salaries
- 8,Example WHILE,
- equals or exceeds $50,000:
- 9,Example WHILE,
-
- 10,Example WHILE,
- DECLARE
- 11,Example WHILE,
- total_sal NUMBER(5);
- 12,Example WHILE,
- BEGIN
- 13,Example WHILE,
- SELECT SUM(sal) INTO total_sal FROM emp;
- 14,Example WHILE,
- WHILE total_sal < 50000 LOOP
- 15,Example WHILE,
- UPDATE emp SET sal = sal * 1.10;
- 16,Example WHILE,
- SELECT SUM(sal) INTO total_sal FROM emp;
- 17,Example WHILE,
- END LOOP;
- 18,Example WHILE,
- END;
- 19,Example WHILE,
-
- 20,Example WHILE,
-
- 21,Example WHILE,
- See also: while, declare, number, select into, update, examples, menu.
- 1,Examples,
-
- 2,Examples,
-
- 3,Examples,
- Examples
- 4,Examples,
-
- 5,Examples,
- Below are examples of SQL and PL/SQL. Enter help example and a topic name
- 6,Examples,
- for an example; enter help exam to see examples in alphabetical order; enter
- 7,Examples,
- a topic name without example for a description of that topic. Words in
- 8,Examples,
- (parentheses) are for clarity; they're not part of the text you enter.
- 9,Examples,
-
- 10,Examples,
- example connect by (and start with) example nextval (and currval)
- 11,Examples,
- example conversion (functions) example nulls (null values)
- 12,Examples,
- example correlated subquery example numeric for (loop with if)
- 13,Examples,
- example cursor for (loop) example outer join
- 14,Examples,
- example cursors (with insert into) example query
- 15,Examples,
- example datatype (parameters) example rollback (to a savepoint)
- 16,Examples,
- example date functions (arithmetic) example select list
- 17,Examples,
- example delete (with rowid) example select into
- 18,Examples,
- example error handling example set operators
- 19,Examples,
- example formats (number and date) example set transaction (read only)
- 20,Examples,
- example group by (and having) example simple join
- 21,Examples,
- example group functions example subquery
- 22,Examples,
- example insert example where current of
- 23,Examples,
- example like (operator) example while (loop)
- 24,Examples,
- example lock table See also: select, commands, menu.
- 1,Example Formats,
-
- 2,Example Formats,
-
- 3,Example Formats,
- Example Formats
- 4,Example Formats,
-
- 5,Example Formats,
- Note how the number formats and date formats affect the output:
- 6,Example Formats,
-
- 7,Example Formats,
-
- 8,Example Formats,
- SELECT TO_CHAR(hiredate, 'MM-DD-YY') hired, HIRED MONTHLY ENAME
- 9,Example Formats,
- TO_CHAR(sal, '$9999') monthly, ename -----------------------
- 10,Example Formats,
- FROM emp 06-09-89 $2450 CLARK
- 11,Example Formats,
- WHERE sal >= 2000 05-01-89 $2850 BLAKE
- 12,Example Formats,
- ORDER BY sal; 04-02-89 $2975 JONES
- 13,Example Formats,
- 01-05-89 $3000 SCOTT
- 14,Example Formats,
- 12-03-89 $3000 FORD
- 15,Example Formats,
- 11-17-89 $5000 KING
- 16,Example Formats,
-
- 17,Example Formats,
-
- 18,Example Formats,
- See also: format dates, format numbers, format modifiers, conversion,
- 19,Example Formats,
- select, examples, menu.
- 1,Expression Forms,
-
- 2,Expression Forms,
-
- 3,Expression Forms,
- Expression Forms
- 4,Expression Forms,
-
- 5,Expression Forms,
- Form of Expression Possible SQL Elements
- 6,Expression Forms,
- ---------------------------------------------------------------------------
- 7,Expression Forms,
- Column, constant, table.column, table.ROWID, ROWNUM, text, number,
- 8,Expression Forms,
- or special value sequence.NEXTVAL, sequence.CURRVAL, NULL, LEVEL,
- 9,Expression Forms,
- SYSDATE, UID, USER
- 10,Expression Forms,
-
- 11,Expression Forms,
- Bind variable :variable
- 12,Expression Forms,
-
- 13,Expression Forms,
- Function reference function_name(DISTINCT or ALL expr, expr...)
- 14,Expression Forms,
-
- 15,Expression Forms,
- A combination of (expr), +expr, -expr, PRIOR expr, expr*expr,
- 16,Expression Forms,
- other expressions expr/expr, expr+expr, expr-expr, expr||expr
- 17,Expression Forms,
-
- 18,Expression Forms,
- List of expressions
- 19,Expression Forms,
- within parentheses (expr1, expr2, expr3, expr4,...)
- 20,Expression Forms,
-
- 21,Expression Forms,
-
- 22,Expression Forms,
- See also: expressions, nextval, pseudo-columns, menu.
- 1,Expressions,
-
- 2,Expressions,
- Expressions
- 3,Expressions,
-
- 4,Expressions,
- A SQL expression is a combination of literals, variables, constants,
- 5,Expressions,
- and operations on their values. Expressions return a value with the
- 6,Expressions,
- same datatype as the expression's components.
- 7,Expressions,
-
- 8,Expressions,
- You can use expressions in:
- 9,Expressions,
- - the SELECT list
- 10,Expressions,
- - conditions of the WHERE and HAVING clauses
- 11,Expressions,
- - the CONNECT BY, START WITH and ORDER BY clauses
- 12,Expressions,
- - the VALUE clause of the INSERT statement
- 13,Expressions,
- - the SET clause of the UPDATE statement
- 14,Expressions,
-
- 15,Expressions,
- Order of evaluation (precedence)
- 16,Expressions,
- 1st: elements enclosed in parentheses
- 17,Expressions,
- 2nd: exponents
- 18,Expressions,
- 3rd: unary operators
- 19,Expressions,
- 4th: multiplication and division
- 20,Expressions,
- 5th: addition, subtraction, concatenation
- 21,Expressions,
-
- 22,Expressions,
- See also: expression forms, literals, variables, select list, where,
- 23,Expressions,
- conditions, connect by, order by, insert, update, menu.
- 1,FETCH,
-
- 2,FETCH,
-
- 3,FETCH,
- FETCH
- 4,FETCH,
- PL/SQL statement
- 5,FETCH,
-
- 6,FETCH,
- FETCH cursor_name INTO variable_name1, variable_name2,...;
- 7,FETCH,
- FETCH cursor_name INTO record_name;
- 8,FETCH,
-
- 9,FETCH,
- FETCH retrieves the next row of data from an explicitly declared and
- 10,FETCH,
- currently open cursor set, and places the data:
- 11,FETCH,
-
- 12,FETCH,
- - INTO variable_name: a list of scalar variables. For every column
- 13,FETCH,
- returned by the cursor-associated query, there must be a variable
- 14,FETCH,
- of the same datatype as the column, or automatically convertible.
- 15,FETCH,
-
- 16,FETCH,
- - INTO record_name: a record variable declared using %ROWTYPE.
- 17,FETCH,
-
- 18,FETCH,
- Use a cursor FOR loop to retrieve data from multiple rows; you don't
- 19,FETCH,
- need to OPEN, FETCH, and CLOSE the cursor for each row.
- 20,FETCH,
-
- 21,FETCH,
-
- 22,FETCH,
- See also: example cursors, cursors, implicit conversions, attributes,
- 23,FETCH,
- cursor for, menu.
- 1,FOR UPDATE OF,
-
- 2,FOR UPDATE OF,
-
- 3,FOR UPDATE OF,
- FOR UPDATE OF
- 4,FOR UPDATE OF,
- SQL clauses
- 5,FOR UPDATE OF,
- SELECT list FROM...
- 6,FOR UPDATE OF,
- FOR UPDATE OF column, column,... --one column is required
- 7,FOR UPDATE OF,
- NOWAIT;
- 8,FOR UPDATE OF,
-
- 9,FOR UPDATE OF,
-
- 10,FOR UPDATE OF,
- FOR UPDATE OF locks the selected rows of a table before one or more
- 11,FOR UPDATE OF,
- UPDATE...WHERE statements. Other users cannot lock or update those
- 12,FOR UPDATE OF,
- rows until they are freed by a COMMIT or ROLLBACK. You can also use
- 13,FOR UPDATE OF,
- FOR UPDATE OF with INSERT and DELETE.
- 14,FOR UPDATE OF,
-
- 15,FOR UPDATE OF,
- You cannot use FOR UPDATE OF with set functions, nor with DISTINCT,
- 16,FOR UPDATE OF,
- GROUP BY, UNION, INTERSECT or MINUS clauses.
- 17,FOR UPDATE OF,
-
- 18,FOR UPDATE OF,
- NOWAIT leaves the statement instead of waiting if any row cannot be
- 19,FOR UPDATE OF,
- locked because someone else is using it.
- 20,FOR UPDATE OF,
-
- 21,FOR UPDATE OF,
-
- 22,FOR UPDATE OF,
- See also: example delete, select, update, commit, rollback, insert,
- 23,FOR UPDATE OF,
- delete, commands, menu.
- 1,FROM,
-
- 2,FROM,
-
- 3,FROM,
- FROM
- 4,FROM,
- SQL clause
- 5,FROM,
- SELECT list
- 6,FROM,
- FROM table WHERE... --SELECT requires FROM
- 7,FROM,
- ...
- 8,FROM,
-
- 9,FROM,
- DELETE FROM table WHERE... --FROM, WHERE optional
- 10,FROM,
- ...
- 11,FROM,
-
- 12,FROM,
- FROM user.table alias @databaselink,... --option within SELECT
- 13,FROM,
- ... and DELETE
- 14,FROM,
-
- 15,FROM,
- The FROM clause identifies one or more tables from which to SELECT
- 16,FROM,
- rows, or the table from which to DELETE rows. If the table is not
- 17,FROM,
- yours, you must specify the user (owner). @databaselink refers to
- 18,FROM,
- a valid remote database.
- 19,FROM,
-
- 20,FROM,
-
- 21,FROM,
- See also: example query, select list, delete, user id, alias, links,
- 22,FROM,
- remote databases, select, menu.
- 1,Files,
-
- 2,Files,
-
- 3,Files,
- Files
- 4,Files,
-
- 5,Files,
- Files Used by SQL*Plus
- 6,Files,
-
- 7,Files,
- Through SQL*Plus, you can store commands in a command file. You can
- 8,Files,
- also create output files (spool files) to save your query results.
- 9,Files,
- Command files and spool files are operating system files and follow
- 10,Files,
- standard naming conventions. Edit with your system's file commands.
- 11,Files,
-
- 12,Files,
-
- 13,Files,
- Command Entry and Execution
- 14,Files,
-
- 15,Files,
- Enter SQL, PL/SQL, and SQL*Plus commands at the command prompt: SQL>
- 16,Files,
- SQL*Plus stores the SQL commands and PL/SQL blocks you enter in the
- 17,Files,
- default buffer (the SQL buffer). You can define other buffers, but
- 18,Files,
- SQL*Plus does not require them.
- 19,Files,
-
- 20,Files,
-
- 21,Files,
- See also: buffer, commands, menu.
- 1,Format Dates,
-
- 2,Format Dates,
-
- 3,Format Dates,
- Format Dates
- 4,Format Dates,
-
- 5,Format Dates,
- Element Meaning in TO_CHAR Element Meaning in TO_CHAR
- 6,Format Dates,
- ----------------------------------------------------------------------------
- 7,Format Dates,
- CC or SCC Century or -BC century Q Quarter (1-4)
- 8,Format Dates,
- YYYY or SYYYY Year or -year BC MM Month (01-12)
- 9,Format Dates,
- YYY or YY or Y Last 3,2,1 yr digits MONTH Month name (pad to 9)
- 10,Format Dates,
- Y,YYY Year with comma here MON Month in 3 chars (JAN)
- 11,Format Dates,
- YEAR or SYEAR Spelled out year WW Week of year (1-52)
- 12,Format Dates,
- AD or BC AD or BC indicator W Week of month (1-5)
- 13,Format Dates,
- A.D. or B.C. A.D. or B.C. DDD Day of year (1-366)
- 14,Format Dates,
- AM or PM Meridian indicator DD Day of month (1-31)
- 15,Format Dates,
- A.M. or P.M. With periods D Day of week (1-7)
- 16,Format Dates,
- HH or HH12 Hour of day (1-12) DAY Day name (pad to 9)
- 17,Format Dates,
- HH24 Hour of day (0-23) DY Day in 3 chars (WED)
- 18,Format Dates,
- MI Minute (00-59) J Julian: number of days
- 19,Format Dates,
- SS Second (00-59) since Jan 1, 4712 B.C.
- 20,Format Dates,
- SSSSS Seconds past midnight (0-86399)
- 21,Format Dates,
-
- 22,Format Dates,
-
- 23,Format Dates,
- See also: format modifiers, conversion (functions), format numbers, menu.
- 1,Format Modifiers,
-
- 2,Format Modifiers,
-
- 3,Format Modifiers,
- Format Modifiers
- 4,Format Modifiers,
-
- 5,Format Modifiers,
- Case modifiers in SQL: MON = APRIL Mon = April mon = april
- 6,Format Modifiers,
- DAY = FRIDAY Day = Friday day = friday
- 7,Format Modifiers,
-
- 8,Format Modifiers,
- Element Meaning
- 9,Format Modifiers,
- -------------------------------------------------------------------------
- 10,Format Modifiers,
- fm Prefix that suppresses blank padding of MONTH, etc.,
- 11,Format Modifiers,
- leaving a variable-length result; mode persists in
- 12,Format Modifiers,
- the format until the next fm restores blank padding.
- 13,Format Modifiers,
-
- 14,Format Modifiers,
- TH Produces ordinal number (DDth for 5th)
- 15,Format Modifiers,
-
- 16,Format Modifiers,
- SP Spells out a number (ddSP for five)
- 17,Format Modifiers,
-
- 18,Format Modifiers,
- THSP, SPTH Spells out an ordinal number (DdthSP for Fifth)
- 19,Format Modifiers,
-
- 20,Format Modifiers,
- 'string' Show string in result
- 21,Format Modifiers,
-
- 22,Format Modifiers,
-
- 23,Format Modifiers,
- See also: format dates, date functions, date (datatype), menu.
- 1,Format Numbers,
-
- 2,Format Numbers,
-
- 3,Format Numbers,
- Format Numbers
- 4,Format Numbers,
-
- 5,Format Numbers,
- Use these SQL format elements in TO_CHAR datatype conversion parameters:
- 6,Format Numbers,
-
- 7,Format Numbers,
- Element Example Action
- 8,Format Numbers,
- ------------------------------------------------------------------------
- 9,Format Numbers,
- 9 99999 The number of 9s sets the display width.
- 10,Format Numbers,
- 0 099 Displays number with leading zeros.
- 11,Format Numbers,
- $ $999 Displays dollar sign in front of number.
- 12,Format Numbers,
- B B99 Displays zeros as blank, not 0.
- 13,Format Numbers,
- MI 999MI Displays a minus sign after a negative number.
- 14,Format Numbers,
- PR 999PR Displays a negative number in <angle brackets>.
- 15,Format Numbers,
- , 9,999 Displays a comma in the position indicated.
- 16,Format Numbers,
- . 9.999 Displays a period in the position indicated.
- 17,Format Numbers,
- V 99V99 Multiplies value by 10 times no. of 9s after V.
- 18,Format Numbers,
- E 9.99EEEE Displays number in scientific notation.
- 19,Format Numbers,
- DATE DATE Stores date in number value in MM/DD/YY format.
- 20,Format Numbers,
-
- 21,Format Numbers,
-
- 22,Format Numbers,
-
- 23,Format Numbers,
- See also: conversion (functions), format dates, menu.
- 1,GET,
-
- 2,GET,
-
- 3,GET,
- GET
- 4,GET,
-
- 5,GET,
- GET file_name[.ext ] [ LIS[T] | NOL[IST] ]
- 6,GET,
-
- 7,GET,
- GET loads a host operating system file into the buffer.
- 8,GET,
-
- 9,GET,
- file_name[.ext ]
- 10,GET,
- is the file to load (typically a command file). If you omit .ext,
- 11,GET,
- SQL*Plus uses the default command-file extension (normally SQL).
- 12,GET,
- For information on changing the default extension, see the SET
- 13,GET,
- command's SUFFIX clause.
- 14,GET,
-
- 15,GET,
- LIS[T]
- 16,GET,
- lists the contents of the file. This is the default.
- 17,GET,
-
- 18,GET,
- NOL[IST]
- 19,GET,
- suppresses the listing of the file's contents.
- 20,GET,
-
- 21,GET,
-
- 22,GET,
- Example: To load a file called YEARENDRPT with the extension SQL into
- 23,GET,
- the buffer, type:
- 24,GET,
-
- 25,GET,
- SQL> GET YEARENDRPT
- 26,GET,
-
- 27,GET,
-
- 28,GET,
- See also: @, /, accept, input, list, run, save, set (buffer), spool,
- 29,GET,
- commands, menu.
- 1,GOTO,
-
- 2,GOTO,
-
- 3,GOTO,
- GOTO
- 4,GOTO,
- <<label_name>> PL/SQL statement
- 5,GOTO,
- statement...
- 6,GOTO,
- ...
- 7,GOTO,
- GOTO label_name;
- 8,GOTO,
-
- 9,GOTO,
- When executed, GOTO transfers control to the statement following
- 10,GOTO,
- the <<label_name>>.
- 11,GOTO,
-
- 12,GOTO,
- The <<label_name>> must be in the same sequence of statements as
- 13,GOTO,
- the GOTO which specifies it, or inside a sequence of statements.
- 14,GOTO,
- In a LOOP or IF statement, GOTO label_3 will transfer control to
- 15,GOTO,
- <<label_3>> only if <<label_3>> is in that LOOP or IF statement.
- 16,GOTO,
-
- 17,GOTO,
- Be sure each <<label_name>> in a block is unique. The same name
- 18,GOTO,
- declaration may appear in enclosing blocks and other blocks.
- 19,GOTO,
-
- 20,GOTO,
-
- 21,GOTO,
- See also: example, loop, if, blocks, identifiers, commands, menu.
- 1,GRANT,
-
- 2,GRANT,
-
- 3,GRANT,
- GRANT
- 4,GRANT,
- SQL statement
- 5,GRANT,
- There are three ways to use GRANT: 1) to provide access to the database;
- 6,GRANT,
- 2) to provide access to tablespaces, with the option of setting a limit on
- 7,GRANT,
- the amount of space available to particular users; and 3) to provide access
- 8,GRANT,
- to database objects (like tables, views, and sequences).
- 9,GRANT,
-
- 10,GRANT,
- *First Method*
- 11,GRANT,
-
- 12,GRANT,
- GRANT database_privilege, database_privilege,...
- 13,GRANT,
- TO username, username,...
- 14,GRANT,
- IDENTIFIED BY password, password,...
- 15,GRANT,
-
- 16,GRANT,
- This type of GRANT provides access to the database. Anyone may use GRANT to
- 17,GRANT,
- change his or her own password; other uses of GRANT require DBA privileges.
- 18,GRANT,
-
- 19,GRANT,
- database_privilege
- 20,GRANT,
- specifies, CONNECT, RESOURCE and/or DBA privileges.
- 21,GRANT,
-
- 22,GRANT,
- password
- 23,GRANT,
- specifies a password for each username; it may be omitted if GRANT
- 24,GRANT,
- is being used to add privileges for an existing username. When
- 25,GRANT,
- multiple usernames and passwords are specified, the first password
- 26,GRANT,
- is for the first username, the second password is for the second
- 27,GRANT,
- username, and so on.
- 28,GRANT,
-
- 29,GRANT,
- CONNECT privilege establishes a new username in the database, enabling the
- 30,GRANT,
- user to connect to the database, operate on objects to which that user has
- 31,GRANT,
- been given privilege, and create views, synonyms, and database links.
- 32,GRANT,
-
- 33,GRANT,
- RESOURCE privilege enables the user to create database objects, including
- 34,GRANT,
- tables, indexes, clusters, and sequences.
- 35,GRANT,
-
- 36,GRANT,
- DBA privileges enable the user to bypass many privileges normally required
- 37,GRANT,
- to use database objects. DBA users may also perform administrative tasks
- 38,GRANT,
- like CREATE TABLESPACE and CREATE ROLLBACK SEGMENT.
- 39,GRANT,
-
- 40,GRANT,
- *Second Method*
- 41,GRANT,
-
- 42,GRANT,
- GRANT RESOURCE quota K | M
- 43,GRANT,
- ON tablespace
- 44,GRANT,
- TO PUBLIC | user, user,...
- 45,GRANT,
-
- 46,GRANT,
- This type of GRANT provides access to tablespaces, with the option of
- 47,GRANT,
- setting a limit on the amount of space available to particular users.
- 48,GRANT,
-
- 49,GRANT,
- RESOURCE
- 50,GRANT,
- enables the users to create objects in the specified tablespace.
- 51,GRANT,
-
- 52,GRANT,
- quota K or M
- 53,GRANT,
- is the number of tablespace bytes the user(s) may allocate. Omit
- 54,GRANT,
- quota for unlimited space. Use 0 to revoke RESOURCE privilege on
- 55,GRANT,
- the tablespace. K = quota x 1024. M = quota x 1,048,576.
- 56,GRANT,
-
- 57,GRANT,
- TO PUBLIC or user, user,...
- 58,GRANT,
- grants the resource to all database users, or to those listed.
- 59,GRANT,
-
- 60,GRANT,
- *Third Method*
- 61,GRANT,
-
- 62,GRANT,
- GRANT object_privilege, object_privilege,... | ALL
- 63,GRANT,
- ON user.object
- 64,GRANT,
- TO PUBLIC | user, user,...
- 65,GRANT,
- WITH GRANT OPTION
- 66,GRANT,
-
- 67,GRANT,
- This type of GRANT provides access to database objects like tables, views,
- 68,GRANT,
- and sequences. You must own the object, have GRANT OPTION on it, or have
- 69,GRANT,
- DBA privileges.
- 70,GRANT,
-
- 71,GRANT,
- object_privilege, object_privilege,...
- 72,GRANT,
- for tables, either: ALTER, DELETE, INDEX, INSERT, REFERENCES,
- 73,GRANT,
- SELECT, or UPDATE
- 74,GRANT,
- for views, either: DELETE, INSERT, SELECT, or UPDATE
- 75,GRANT,
- for sequences, either: ALTER or SELECT
- 76,GRANT,
-
- 77,GRANT,
- The UPDATE privilege can restrict updates to specific columns;
- 78,GRANT,
- the syntax is: GRANT UPDATE column, column,...
- 79,GRANT,
-
- 80,GRANT,
- ALL PRIVILEGES
- 81,GRANT,
- grants all privileges possible on the specified object.
- 82,GRANT,
-
- 83,GRANT,
- WITH GRANT OPTION
- 84,GRANT,
- enables the grantee to grant his/her privileges to another user.
- 85,GRANT,
-
- 86,GRANT,
- See also: alter user, revoke, create sequence, dba, commands, menu.
- 1,GROUP BY,
-
- 2,GROUP BY,
-
- 3,GROUP BY,
- GROUP BY (and HAVING)
- 4,GROUP BY,
- SQL clauses
- 5,GROUP BY,
-
- 6,GROUP BY,
- SELECT list... --only one expr required
- 7,GROUP BY,
- FROM table, table... --only one table required
- 8,GROUP BY,
- WHERE condition --not required
- 9,GROUP BY,
- GROUP BY expr, expr,... --only one expr required
- 10,GROUP BY,
- HAVING condition --not required
- 11,GROUP BY,
-
- 12,GROUP BY,
- With the GROUP BY clause, SELECT computes one summary row for each
- 13,GROUP BY,
- group of selected rows. Every SELECT list expression must either:
- 14,GROUP BY,
-
- 15,GROUP BY,
- - be a function or constant with no parameter, like SYSDATE;
- 16,GROUP BY,
- - contain a group function like SUM, COUNT, or MAX;
- 17,GROUP BY,
- - match a GROUP BY expr.
- 18,GROUP BY,
-
- 19,GROUP BY,
- The HAVING condition sets which GROUP BY groups appear in the result.
- 20,GROUP BY,
-
- 21,GROUP BY,
-
- 22,GROUP BY,
- See also: example group by, select list, expressions, conditions,
- 23,GROUP BY,
- group functions, select, commands, menu.
- 1,Group Functions,
-
- 2,Group Functions,
-
- 3,Group Functions,
- Group Functions
- 4,Group Functions,
-
- 5,Group Functions,
- SQL group functions return results based on groups of rows. You can
- 6,Group Functions,
- use them only in SQL queries and subqueries.
- 7,Group Functions,
-
- 8,Group Functions,
- AVG(D|A expr) Gives average of expr values across rows.
- 9,Group Functions,
-
- 10,Group Functions,
- COUNT(D|A expr) Gives number of rows where expr is not null.
- 11,Group Functions,
- COUNT(*) Gives total number of rows, including nulls.
- 12,Group Functions,
-
- 13,Group Functions,
- MAX(D|A expr) Gives maximum expr value across rows.
- 14,Group Functions,
- MIN(D|A expr) Gives minimum expr value across rows.
- 15,Group Functions,
-
- 16,Group Functions,
- STDDEV(D|A expr) Gives standard deviation of expr values in rows.
- 17,Group Functions,
- SUM(D|A expr) Gives the sum of expr values across rows.
- 18,Group Functions,
- VARIANCE(D|A expr) Gives variance of expr values across rows.
- 19,Group Functions,
-
- 20,Group Functions,
- D|A = DISTINCT values or ALL (default=ALL). Null values are ignored
- 21,Group Functions,
- except in COUNT(*).
- 22,Group Functions,
-
- 23,Group Functions,
- See also: example group functions, query, 1 row char, 1 row number,
- 24,Group Functions,
- conversion, date functions, error reporting, other functions,
- 25,Group Functions,
- examples, commands, menu.
- 1,HAVING,
-
- 2,HAVING,
-
- 3,HAVING,
- HAVING (and GROUP BY)
- 4,HAVING,
- SQL clauses
- 5,HAVING,
-
- 6,HAVING,
- SELECT list... --only one expr required
- 7,HAVING,
- FROM table, table... --only one table required
- 8,HAVING,
- WHERE condition --not required
- 9,HAVING,
- GROUP BY expr, expr,... --only one expr required
- 10,HAVING,
- HAVING condition --not required
- 11,HAVING,
-
- 12,HAVING,
- The HAVING condition sets which GROUP BY groups appear in the result.
- 13,HAVING,
-
- 14,HAVING,
- With the GROUP BY clause, SELECT computes one summary row for each
- 15,HAVING,
- group of selected rows. Every SELECT list expression must either:
- 16,HAVING,
-
- 17,HAVING,
- - be a function or constant with no parameter, like SYSDATE;
- 18,HAVING,
- - contain a group function like SUM, COUNT, or MAX;
- 19,HAVING,
- - match a GROUP BY expr.
- 20,HAVING,
-
- 21,HAVING,
-
- 22,HAVING,
- See also: example group by, select list, expressions, conditions,
- 23,HAVING,
- group functions, select, commands, menu.
- 1,HELP,
-
- 2,HELP,
-
- 3,HELP,
- HELP
- 4,HELP,
-
- 5,HELP,
- HELP [topic] | help
- 6,HELP,
-
- 7,HELP,
- HELP displays information on the commands and conventions of SQL*Plus,
- 8,HELP,
- SQL, and PL/SQL. Type help, a space, all or part of any topic, and
- 9,HELP,
- then press Enter.
- 10,HELP,
-
- 11,HELP,
- Typing only part of a topic will cause all help topics that match the
- 12,HELP,
- partial topic to be displayed on your screen in alphabetical order.
- 13,HELP,
- For example, HELP SE will retrieve help on the SELECT statement, the
- 14,HELP,
- SET command, and the Set Operators--in that order.
- 15,HELP,
-
- 16,HELP,
- ENTER THIS... TO DISPLAY THIS...
- 17,HELP,
- --------------------------------------------------------------
- 18,HELP,
- help menu the main menu of help topics
- 19,HELP,
- help commands a list of SQL*Plus, SQL, and PL/SQL commands
- 20,HELP,
- help comm information on commands, comments, and commit
- 21,HELP,
- help help this screen
- 22,HELP,
- help examples the menu of examples
- 23,HELP,
-
- 24,HELP,
-
- 1,HOST,
-
- 2,HOST,
-
- 3,HOST,
- HOST
- 4,HOST,
-
- 5,HOST,
- HO[ST] [ command ]
- 6,HOST,
-
- 7,HOST,
- HOST executes a host operating system command without leaving SQL*Plus.
- 8,HOST,
-
- 9,HOST,
- command
- 10,HOST,
- is a host operating system command. Enter HOST without command to
- 11,HOST,
- display an operating system prompt. You can then enter multiple
- 12,HOST,
- operating system commands. To return to SQL*Plus, type LOGOFF,
- 13,HOST,
- EXIT, QUIT, or other command applicable to your operating system.
- 14,HOST,
-
- 15,HOST,
- With some operating systems, you can use $ or another character instead
- 16,HOST,
- of HOST. You may or may not have access to the HOST command, depending
- 17,HOST,
- on your operating system, and privileges assigned by your system
- 18,HOST,
- administrator.
- 19,HOST,
-
- 20,HOST,
-
- 21,HOST,
- Example: To execute an operating system command, ls *.sql, enter:
- 22,HOST,
-
- 23,HOST,
- SQL> HOST ls *.sql
- 24,HOST,
-
- 25,HOST,
-
- 26,HOST,
- See also: change, del, edit, exit, commands, menu.
- 1,IF,
-
- 2,IF,
-
- 3,IF,
- IF
- 4,IF,
- PL/SQL statement
- 5,IF,
- When IF evaluates condition_1 as TRUE its series_of_statements is
- 6,IF,
- executed. When FALSE, it passes control to ELSIF which evaluates
- 7,IF,
- condition_2 similarly, and so on until ELSE, whose statements are
- 8,IF,
- executed only when no conditions of IF and ELSEIF evaluate to TRUE.
- 9,IF,
-
- 10,IF,
- IF condition_1 THEN
- 11,IF,
- series_of_statements;
- 12,IF,
-
- 13,IF,
- ELSIF condition_2 THEN
- 14,IF,
- series_of_statements;
- 15,IF,
-
- 16,IF,
- ELSIF condition_3 THEN
- 17,IF,
- series_of_statements;...
- 18,IF,
-
- 19,IF,
- ELSE series_of_statements;
- 20,IF,
-
- 21,IF,
- ENDIF;
- 22,IF,
-
- 23,IF,
- See also: example numeric for, conditions, boolean comparisons, end,
- 24,IF,
- nulls, commands, menu.
- 1,INPUT,
-
- 2,INPUT,
-
- 3,INPUT,
- INPUT
- 4,INPUT,
-
- 5,INPUT,
- I[NPUT] [ text ]
- 6,INPUT,
-
- 7,INPUT,
- INPUT adds one or more lines of text after the current line in the buffer.
- 8,INPUT,
-
- 9,INPUT,
- text
- 10,INPUT,
- is the text to add. To add one line, enter INPUT, a space, and
- 11,INPUT,
- the text. (To begin the line with one or more spaces, enter two
- 12,INPUT,
- or more spaces after INPUT.) To add several lines, enter INPUT
- 13,INPUT,
- without text; INPUT prompts you for each line. To leave INPUT,
- 14,INPUT,
- enter an empty line.
- 15,INPUT,
-
- 16,INPUT,
- At the command prompt, if you enter a line number larger than the number
- 17,INPUT,
- of lines in the buffer, and follow the number with text, SQL*Plus adds
- 18,INPUT,
- the text in a new line at the end of the buffer. If you specify zero (0)
- 19,INPUT,
- for the line number and follow the zero with text, SQL*Plus inserts the
- 20,INPUT,
- line at the beginning of the buffer; that line becomes line 1.
- 21,INPUT,
-
- 22,INPUT,
- Examples: The SQL buffer contains the following command:
- 23,INPUT,
-
- 24,INPUT,
- 1 SELECT ENAME, DEPTNO, SAL, COMM
- 25,INPUT,
- 2 FROM EMP
- 26,INPUT,
-
- 27,INPUT,
- To add an ORDER BY clause to the query, enter:
- 28,INPUT,
-
- 29,INPUT,
- SQL> LIST 2
- 30,INPUT,
- 2* FROM EMP
- 31,INPUT,
-
- 32,INPUT,
- SQL> INPUT ORDER BY ENAME
- 33,INPUT,
-
- 34,INPUT,
- LIST 2 ensures that line 2 is the current line. INPUT adds a
- 35,INPUT,
- line with the ORDER BY clause after the current line. The SQL
- 36,INPUT,
- buffer now contains:
- 37,INPUT,
-
- 38,INPUT,
- 1 SELECT ENAME, DEPTNO, SAL, COMM
- 39,INPUT,
- 2 FROM EMP
- 40,INPUT,
- 3* ORDER BY ENAME
- 41,INPUT,
-
- 42,INPUT,
- To add a two-line WHERE clause, enter:
- 43,INPUT,
-
- 44,INPUT,
- SQL> LIST 2
- 45,INPUT,
- 2* FROM EMP
- 46,INPUT,
- SQL> INPUT
- 47,INPUT,
- 3 WHERE JOB = 'SALESMAN'
- 48,INPUT,
- 4 AND COMM 500
- 49,INPUT,
- 5
- 50,INPUT,
-
- 51,INPUT,
- INPUT continues to prompt you for new lines until you enter an
- 52,INPUT,
- empty line. The SQL buffer now contains the following lines:
- 53,INPUT,
-
- 54,INPUT,
- 1 SELECT ENAME, DEPTNO, SAL, COMM
- 55,INPUT,
- 2 FROM EMP
- 56,INPUT,
- 3 WHERE JOB = 'SALESMAN'
- 57,INPUT,
- 4 AND COMM 500
- 58,INPUT,
- 5 ORDER BY ENAME
- 59,INPUT,
-
- 60,INPUT,
-
- 61,INPUT,
- See also: change, del, edit, list, save, spool, get, input,
- 62,INPUT,
- set (SQL buffer), prompt, commands, menu.
- 1,INSERT,
-
- 2,INSERT,
-
- 3,INSERT,
- INSERT
- 4,INSERT,
- SQL statement
- 5,INSERT,
-
- 6,INSERT,
- INSERT INTO t/v_name (column, column,...) --(column list) optional
- 7,INSERT,
- VALUES(value, value,...);
- 8,INSERT,
-
- 9,INSERT,
- INSERT INTO t/v_name (column, column,...) SELECT...;
- 10,INSERT,
-
- 11,INSERT,
- INSERT adds rows to the table or view specified. Names in the column
- 12,INSERT,
- list may be in any order. Unlisted columns are set to NULL; you must
- 13,INSERT,
- list any column created NOT NULL, and supply a value for it.
- 14,INSERT,
-
- 15,INSERT,
- VALUES inserts each item in its list of values into the corresponding
- 16,INSERT,
- column in the list of columns. The datatypes of each pair of items in
- 17,INSERT,
- the two lists must be compatible or convertible. CHAR and DATE values
- 18,INSERT,
- must be enclosed in 'single quotes'.
- 19,INSERT,
-
- 20,INSERT,
- Use a subquery to INSERT rows from another table. SELECT must return
- 21,INSERT,
- a value for each column listed.
- 22,INSERT,
-
- 23,INSERT,
- See also: example insert, example cursor for, sql% cursor, nulls,
- 24,INSERT,
- subquery, commands, menu.
- 1,Identifiers,
-
- 2,Identifiers,
-
- 3,Identifiers,
- Identifiers
- 4,Identifiers,
-
- 5,Identifiers,
- Identifiers are names of variables and constants, aliases, tables,
- 6,Identifiers,
- columns, views, indexes, and other objects. An identifier must be
- 7,Identifiers,
- 1-30 characters long and begin with a letter. It may have letters,
- 8,Identifiers,
- numbers, and the $ _ # symbols. It may not contain spaces or be a
- 9,Identifiers,
- SQL or PL/SQL reserved word. Case is ignored.
- 10,Identifiers,
-
- 11,Identifiers,
- An identifier enclosed within "quotation marks" may use a reserved
- 12,Identifiers,
- word or contain any characters, including spaces. Identifiers must
- 13,Identifiers,
- be separated from each other by at least 1 space or by punctuation.
- 14,Identifiers,
-
- 15,Identifiers,
- ALLOWED NOT ALLOWED and WHY NOT
- 16,Identifiers,
- ------------- ---------------------------------
- 17,Identifiers,
- Balance_Due BALANCE DUE uses a space
- 18,Identifiers,
- client_1 1st_client begins with 1
- 19,Identifiers,
- "row" row reserved word
- 20,Identifiers,
- largest_$ $largest begins with $
- 21,Identifiers,
-
- 22,Identifiers,
-
- 23,Identifiers,
- See also: variables, alias, scoping rules, reserved words, menu.
- 1,Implicit Conversions,
-
- 2,Implicit Conversions,
-
- 3,Implicit Conversions,
- Implicit Conversions
- 4,Implicit Conversions,
-
- 5,Implicit Conversions,
- PL/SQL converts a variable of one datatype to an expected datatype
- 6,Implicit Conversions,
- by implicitly calling a TO_NUMBER, TO_CHAR, or TO_DATE function in:
- 7,Implicit Conversions,
-
- 8,Implicit Conversions,
- Assignments (CHAR to NUMBER or DATE, NUMBER or DATE to CHAR)
- 9,Implicit Conversions,
- variable := expression
- 10,Implicit Conversions,
- INSERT INTO table VALUES...
- 11,Implicit Conversions,
- UPDATE table SET column = expression...
- 12,Implicit Conversions,
- SELECT expr INTO variable FROM...
- 13,Implicit Conversions,
-
- 14,Implicit Conversions,
- Expression Evaluation (CHAR to NUMBER, CHAR to DATE)
- 15,Implicit Conversions,
- Simple expressions: bal + '44'
- 16,Implicit Conversions,
- Boolean expressions: bonus > salary / '20'
- 17,Implicit Conversions,
- Function and procedure calls: MOD(counter, '3')
- 18,Implicit Conversions,
- WHERE clause conditions: WHERE hiredate = '15-MAR-89'
- 19,Implicit Conversions,
-
- 20,Implicit Conversions,
- CHAR to DATE conversions require a string with the format DD-MON-YY.
- 21,Implicit Conversions,
-
- 22,Implicit Conversions,
-
- 23,Implicit Conversions,
- See also: conversion (functions), expressions, where, menu.
- 1,Index,
-
- 2,Index,
-
- 3,Index,
- Index
- 4,Index,
-
- 5,Index,
- Enter help, a space, and then part or all of the help topic you want:
- 6,Index,
-
- 7,Index,
- ACCEPT Boolean Comparisons Constraints (clauses)
- 8,Index,
- Alias BREAK Conversion Functions
- 9,Index,
- ALTER CLUSTER BTITLE COPY
- 10,Index,
- ALTER DATABASE Buffer Correlated Subquery
- 11,Index,
- ALTER INDEX CHANGE CREATE CLUSTER
- 12,Index,
- ALTER ROLLBACK (SEGMENT) CHAR CREATE DATABASE
- 13,Index,
- ALTER SEQUENCE CLEAR CREATE DB LINK
- 14,Index,
- ALTER TABLE CLOSE CREATE INDEX
- 15,Index,
- ALTER TABLESPACE COLUMN CREATE ROLLBACK (SEGMENT)
- 16,Index,
- ALTER USER Commands CREATE SEQUENCE
- 17,Index,
- APPEND COMMENT CREATE SYNONYM
- 18,Index,
- Arithmetic (& char) Oper Comments CREATE TABLE
- 19,Index,
- Attributes COMMIT CREATE TABLESPACE
- 20,Index,
- AUDIT Comparison (operators) CREATE VIEW
- 21,Index,
- BEGIN COMPUTE CREATE Attributes
- 22,Index,
- Blocks Conditions Cursor FOR
- 23,Index,
- BNF Syntax CONNECT Cursors
- 24,Index,
- BOOLEAN CONNECT BY
- 25,Index,
-
- 26,Index,
-
- 27,Index,
- Data Dictionary DROP TABLE Example INSERT
- 28,Index,
- DATE DROP TABLESPACE Example LIKE
- 29,Index,
- Date Functions DROP VIEW Example LOCK TABLE
- 30,Index,
- DBA EDIT Example NEXTVAL
- 31,Index,
- DECLARE END Example Nulls
- 32,Index,
- DECLARE CURSOR Error Handling Example Numeric FOR
- 33,Index,
- DEFINE Error Reporting (Functions) Example Outer Join
- 34,Index,
- DEL Example CONNECT BY Example Query
- 35,Index,
- DELETE Example Conversion Example ROLLBACK
- 36,Index,
- Delimiters Example Correlated Subquery Example SELECT INTO
- 37,Index,
- DESCRIBE Example CURSOR FOR Example SELECT List
- 38,Index,
- DISCONNECT Example Cursors Example Set Operators
- 39,Index,
- Distributed Query Example Datatype Example SET TRANSACTION
- 40,Index,
- DROP CLUSTER Example Date Functions Example Simple Join
- 41,Index,
- DROP DATABASE LINK Example DELETE Example Subquery
- 42,Index,
- DROP INDEX Example Error Handling Example WHERE CURRENT OF
- 43,Index,
- DROP ROLLBACK SEGMENT Example Formats Example WHILE
- 44,Index,
- DROP SEQUENCE Example GROUP BY Examples
- 45,Index,
- DROP SYNONYM Example Group Functions EXCEPTION
- 46,Index,
-
- 47,Index,
-
- 48,Index,
- EXIT Identifiers Menu
- 49,Index,
- EXIT PLSQL IF NEXTVAL
- 50,Index,
- Expression Forms Implicit Conversions NOAUDIT
- 51,Index,
- Expressions Index NOWAIT
- 52,Index,
- FETCH INPUT NULL
- 53,Index,
- Files INSERT Nulls
- 54,Index,
- FOR UPDATE OF Join NUMBER
- 55,Index,
- Format Dates Keys Numeric FOR
- 56,Index,
- Format Modifiers LIKE Operator Old (SQL*Plus Commands)
- 57,Index,
- Format Numbers Limits (SQL*Plus) OPEN
- 58,Index,
- FROM Links ORDER BY
- 59,Index,
- GET LIST Other Functions
- 60,Index,
- GOTO Literals Other Operators
- 61,Index,
- GRANT LOCK TABLE Outer Join
- 62,Index,
- GROUP BY (& HAVING) Logical Operators Overview (of SQL*Plus)
- 63,Index,
- Group Functions Long Parameters
- 64,Index,
- HAVING (& GOUP BY) Long raw PAUSE
- 65,Index,
- HELP LOOP PL/SQL Exceptions
- 66,Index,
- HOST Loops PRAGMA EXCEPTION_INIT
- 67,Index,
-
- 68,Index,
-
- 69,Index,
- PROMPT SELECT INTO Transactions
- 70,Index,
- Pseudo-Columns SELECT List Tree-Structured Query
- 71,Index,
- Query Sequences TTITLE
- 72,Index,
- QUIT SET UNDEFINE
- 73,Index,
- RAISE Set Operators UPDATE
- 74,Index,
- RAW SET TRANSACTION User ID
- 75,Index,
- REMARK SHOW Uses of SELECT
- 76,Index,
- Remote Databases SPOOL VALIDATE INDEX
- 77,Index,
- RENAME SQL in PL/SQL Variables (and constants)
- 78,Index,
- Reserved Words SQL% Cursor Views (and Indexes)
- 79,Index,
- REVOKE SQLPlus WHENEVER SQLERROR
- 80,Index,
- ROLLBACK START WHERE
- 81,Index,
- RUN START WITH WHERE CURRENT OF
- 82,Index,
- RUNFORM Subquery WHILE
- 83,Index,
- SAVE Substitution 1 Row Char (Functions)
- 84,Index,
- SAVEPOINT Synonyms 1 Row Number (Functions)
- 85,Index,
- Scoping Rules Tables (columns, rows) / (slash)
- 86,Index,
- SELECT TIMING @ ("at" sign)
- 87,Index,
-
- 88,Index,
-
- 89,Index,
- See also: select, uses of select, examples, index, commands, menu.
- 1,Join,
-
- 2,Join,
- Join
- 3,Join,
-
- 4,Join,
- SELECT column, table.column, ... --table. optional
- 5,Join,
- FROM table1, table2, ...
- 6,Join,
- WHERE table1.column1 = table2.column1 --WHERE clause optional
- 7,Join,
-
- 8,Join,
-
- 9,Join,
- A join combines rows from two or more tables; in the result, each
- 10,Join,
- row has data from several tables. The WHERE clause specifies how
- 11,Join,
- the rows are combined.
- 12,Join,
-
- 13,Join,
- If you select a column that exists in more than one of the tables
- 14,Join,
- in the join, prefix the column name with the table name: emp.sal.
- 15,Join,
-
- 16,Join,
- A simple join returns rows from two tables; the rows returned are
- 17,Join,
- those with matching values in the specified column of each table.
- 18,Join,
- If the WHERE clause is omitted, all rows from all tables combine;
- 19,Join,
- 2 tables 300 rows each returns 90,000 rows--rarely what you want.
- 20,Join,
-
- 21,Join,
-
- 22,Join,
- See also: example simple join, select, where, uses of select, menu.
- 1,Keys,
-
- 2,Keys,
-
- 3,Keys,
- Keys
- 4,Keys,
-
- 5,Keys,
- A PRIMARY KEY is one or more columns in a table used to uniquely
- 6,Keys,
- identify each row in the table. Primary key values should never
- 7,Keys,
- change, and should never be null.
- 8,Keys,
-
- 9,Keys,
- A FOREIGN KEY is a column with the same value as the primary key
- 10,Keys,
- in another (or the same) table. A foreign key value may be null.
- 11,Keys,
- For example, the DEPTNO column is the primary key of table DEPT;
- 12,Keys,
- in table EMP, DEPTNO is a foreign key that references the DEPTNO
- 13,Keys,
- values in table DEPT.
- 14,Keys,
-
- 15,Keys,
- A UNIQUE KEY is similar to a primary key, except the purpose of a
- 16,Keys,
- unique key is to ensure unique information in the column for each
- 17,Keys,
- record, as with telephone or driver's license numbers. A primary
- 18,Keys,
- key should only identify each row uniquely, not contain any other
- 19,Keys,
- information (although it CAN). A table may have many unique keys.
- 20,Keys,
-
- 21,Keys,
-
- 22,Keys,
- See also: tables, create table, alter table, nulls, menu.
- 1,LIKE Operator,
-
- 2,LIKE Operator,
-
- 3,LIKE Operator,
- LIKE Operator
- 4,LIKE Operator,
-
- 5,LIKE Operator,
- SELECT...
- 6,LIKE Operator,
- WHERE char LIKE 'pattern'
- 7,LIKE Operator,
- ...
- 8,LIKE Operator,
-
- 9,LIKE Operator,
- The SQL LIKE operator matches part of the char string to part of the
- 10,LIKE Operator,
- 'pattern' string. You can use two "wild card" matching characters in
- 11,LIKE Operator,
- the 'pattern': % (percent sign) matches zero or more characters;
- 12,LIKE Operator,
- _ (underscore) matches exactly one character.
- 13,LIKE Operator,
-
- 14,LIKE Operator,
-
- 15,LIKE Operator,
- String literals must be within 'apostrophes'. Case is significant.
- 16,LIKE Operator,
-
- 17,LIKE Operator,
- This expression... will select these values... but not these...
- 18,LIKE Operator,
- ---------------------------------------------------------------------
- 19,LIKE Operator,
- lname LIKE 'S_ile%' Smile, Stiles, Skilerson smile, Samiler
- 20,LIKE Operator,
- title LIKE '%ager' Manager, dowager, pager MANAGER, agent
- 21,LIKE Operator,
-
- 22,LIKE Operator,
-
- 23,LIKE Operator,
- See also: example like, comparison (operators), expression, menu.
- 1,LIST,
-
- 2,LIST,
-
- 3,LIST,
- LIST
- 4,LIST,
-
- 5,LIST,
- L[IST] [ n | n m | n * | n LAST | * | * n | * LAST | LAST]
- 6,LIST,
-
- 7,LIST,
-
- 8,LIST,
- LIST displays one or more lines of the buffer. Enter LIST by itself to
- 9,LIST,
- list all lines.
- 10,LIST,
-
- 11,LIST,
- Clause Lists
- 12,LIST,
- -------- ----------------------------------------
- 13,LIST,
- n line n.
- 14,LIST,
- n m lines n through m.
- 15,LIST,
- n * line n through the current line.
- 16,LIST,
- n LAST line n through the last line.
- 17,LIST,
- * the current line.
- 18,LIST,
- * n the current line through line n.
- 19,LIST,
- * LAST the current line through the last line.
- 20,LIST,
- LAST the last line.
- 21,LIST,
-
- 22,LIST,
-
- 23,LIST,
- You can omit the space between LIST and n or *, but not between LIST and
- 24,LIST,
- LAST. The last line listed is the new current line (with an asterisk).
- 25,LIST,
-
- 26,LIST,
-
- 27,LIST,
- Example: To list the contents of the buffer, enter:
- 28,LIST,
-
- 29,LIST,
- SQL> L
- 30,LIST,
-
- 31,LIST,
- You will see a listing of all lines in the buffer, like this:
- 32,LIST,
-
- 33,LIST,
- 1 SELECT ENAME, DEPTNO, JOB
- 34,LIST,
- 2 FROM EMP
- 35,LIST,
- 3 WHERE JOB = 'CLERK'
- 36,LIST,
- 4* ORDER BY DEPTNO
- 37,LIST,
-
- 38,LIST,
- The asterisk shows line 4 to be the current line. To list the
- 39,LIST,
- second line only, enter:
- 40,LIST,
-
- 41,LIST,
- SQL> L 2
- 42,LIST,
- 2* FROM EMP
- 43,LIST,
-
- 44,LIST,
- To list the current line (now line 2) to the last line, enter:
- 45,LIST,
-
- 46,LIST,
- SQL> L * LAST
- 47,LIST,
- 2 FROM EMP
- 48,LIST,
- 3 WHERE JOB = 'CLERK'
- 49,LIST,
- 4* ORDER BY DEPTNO
- 50,LIST,
-
- 51,LIST,
-
- 52,LIST,
- See also: change, del, edit, get, input, save, spool, set (SQL buffer),
- 53,LIST,
- commands, menu.
- 1,LOCK TABLE,
-
- 2,LOCK TABLE,
-
- 3,LOCK TABLE,
- LOCK TABLE
- 4,LOCK TABLE,
- SQL statement
- 5,LOCK TABLE,
-
- 6,LOCK TABLE,
- LOCK TABLE user.table, user.table... --user. is optional
- 7,LOCK TABLE,
- IN lockmode MODE NOWAIT; --NOWAIT is optional
- 8,LOCK TABLE,
-
- 9,LOCK TABLE,
- LOCK TABLE limits access to one or more tables, specified by lockmode:
- 10,LOCK TABLE,
-
- 11,LOCK TABLE,
- LOCKMODE ALLOWS PROHIBITS
- 12,LOCK TABLE,
- -------------------------------------------------------------------------
- 13,LOCK TABLE,
- SHARE queries, SHARE locks updates, inserts, deletes
- 14,LOCK TABLE,
- EXCLUSIVE queries only any other activity
- 15,LOCK TABLE,
- ROW SHARE concurrent use entire table locks
- 16,LOCK TABLE,
- ROW EXCLUSIVE concurrent use SHARE mode locks
- 17,LOCK TABLE,
- SHARE ROW EXCLUSIVE queries SHARE mode locks, updates
- 18,LOCK TABLE,
-
- 19,LOCK TABLE,
- Once locked, a table remains locked during a DELETE, INSERT, or UPDATE
- 20,LOCK TABLE,
- operation until a COMMIT or ROLLBACK of the transaction. If a table is
- 21,LOCK TABLE,
- already locked, NOWAIT returns control to the user.
- 22,LOCK TABLE,
-
- 23,LOCK TABLE,
- See also: example lock table, query, delete, insert, update, commit,
- 24,LOCK TABLE,
- nowait, rollback, savepoint, bnf syntax, commands, menu.
- 1,LONG,
-
- 2,LONG,
-
- 3,LONG,
- LONG
- 4,LONG,
-
- 5,LONG,
- LONG --SQL only; can't be used for PL/SQL variables
- 6,LONG,
-
- 7,LONG,
- Columns defined to be LONG store variable-length strings up to 65,535
- 8,LONG,
- characters. A table may have one LONG column. Use LONG columns in the
- 9,LONG,
- SELECT list and in the SET clauses of UPDATE and DELETE. Long columns
- 10,LONG,
- cannot be indexed or referenced by functions. They cannot be used:
- 11,LONG,
- - in expressions
- 12,LONG,
- - in the SELECT list of a nested query, nor in a distributed
- 13,LONG,
- query
- 14,LONG,
- - in a query connected by UNION, INTERSECT or MINUS clauses
- 15,LONG,
- - with with WHERE, GROUP BY, ORDER BY, CONNECT BY, or DISTINCT
- 16,LONG,
-
- 17,LONG,
-
- 18,LONG,
- See also: conversion, variables, number, char, long raw, date, boolean,
- 19,LONG,
- raw, menu.
- 1,LONG RAW,
-
- 2,LONG RAW,
-
- 3,LONG RAW,
- LONG RAW
- 4,LONG RAW,
-
- 5,LONG RAW,
- LONG RAW
- 6,LONG RAW,
-
- 7,LONG RAW,
- Use the LONG RAW datatype in SQL to store byte-oriented data:
- 8,LONG RAW,
- character strings, and graphics character sequences. ORACLE
- 9,LONG RAW,
- displays RAW data as hexidecimal character values.
- 10,LONG RAW,
-
- 11,LONG RAW,
-
- 12,LONG RAW,
- The LONG RAW datatype is the same as LONG, except over SQL*Net,
- 13,LONG RAW,
- at which time SQL*Net will convert between ASCII and EBCIDIC
- 14,LONG RAW,
- character set representations for CHAR data.
- 15,LONG RAW,
-
- 16,LONG RAW,
-
- 17,LONG RAW,
- See also: connect, char, date, number, long, boolean, raw, menu.
- 1,LOOP,
-
- 2,LOOP,
-
- 3,LOOP,
- LOOP
- 4,LOOP,
- PL/SQL statement
- 5,LOOP,
- <<label_name>> --<<label_name>> optional on any loop
- 6,LOOP,
- LOOP
- 7,LOOP,
- sequence_of_statements
- 8,LOOP,
- END LOOP label_name; --If a label_name appears before LOOP,
- 9,LOOP,
- it must be used after END LOOP.
- 10,LOOP,
-
- 11,LOOP,
- Basic loops are often used with the FETCH statement. Use GOTO, RAISE,
- 12,LOOP,
- or EXIT to terminate a basic loop:
- 13,LOOP,
-
- 14,LOOP,
- <<first>>
- 15,LOOP,
- LOOP
- 16,LOOP,
- FETCH cursor_name INTO record_name;
- 17,LOOP,
- EXIT WHEN cursor_name %NOTFOUND;
- 18,LOOP,
- data_manipulation_statements
- 19,LOOP,
- END LOOP first;
- 20,LOOP,
-
- 21,LOOP,
-
- 22,LOOP,
- Other loops: while, cursor for, numeric for.
- 23,LOOP,
- See also: fetch, goto, raise, exit, end, commands, menu.
- 1,Limits,
-
- 2,Limits,
-
- 3,Limits,
- Limits
- 4,Limits,
-
- 5,Limits,
- These limits apply to most systems, but not to PDP11 or mc68000.
- 6,Limits,
-
- 7,Limits,
- Item SQL*Plus Limit
- 8,Limits,
- --------------------------------------------------------------------------
- 9,Limits,
- file name length system-dependent
- 10,Limits,
- username length 30 characters
- 11,Limits,
- user variable name length 30 characters
- 12,Limits,
- user variable value length 240 characters
- 13,Limits,
- number of user variables 1,024
- 14,Limits,
- variables in INSERT INTO list 50
- 15,Limits,
- variables per SQL command 100
- 16,Limits,
- command line length 500 characters
- 17,Limits,
- length of LONG value in SQL*Plus 250 characters
- 18,Limits,
- output line size 500 characters (minimum = 5 characters)
- 19,Limits,
- line after variable substitution 1,000 characters (internal only)
- 20,Limits,
- number of lines per command 500 (assuming 80 characters per line)
- 21,Limits,
- number of lines per page 50,000
- 22,Limits,
- total row width 60,000 characters in VMS; else, 32,767
- 23,Limits,
- rows in an array fetch 5000 rows
- 24,Limits,
- nested command files 20 for VMS, CMS, Unix; otherwise, 5
- 25,Limits,
- page numbers 99,999 pages
- 26,Limits,
-
- 27,Limits,
- See also: commands, menu.
- 1,Links,
-
- 2,Links,
-
- 3,Links,
- Links
- 4,Links,
-
- 5,Links,
- A database link provides access to a remote database from the local
- 6,Links,
- database. To use a link, you must know a valid username on a remote
- 7,Links,
- database, local and remote systems must be connected to each other,
- 8,Links,
- and SQL*Net must be active on both. A non-ORACLE database requires
- 9,Links,
- SQL*Connect active as well.
- 10,Links,
-
- 11,Links,
- To access a table in a remote database use its linkname in the FROM
- 12,Links,
- clause of a query or a subquery. SELECT * FROM powers.dept@PACIFIC
- 13,Links,
- connects the user to the database link PACIFIC and accesses a table
- 14,Links,
- named DEPT owned by POWERS.
- 15,Links,
-
- 16,Links,
- Database links are used in distributed queries. A single statement
- 17,Links,
- is usually limited to four links. LONG columns cannot be selected
- 18,Links,
- through a link.
- 19,Links,
-
- 20,Links,
-
- 21,Links,
- See also: distributed query, remote databases, create db link, menu.
- 1,Literals,
-
- 2,Literals,
-
- 3,Literals,
- Literals
- 4,Literals,
-
- 5,Literals,
- A SQL literal is a number or character string.
- 6,Literals,
-
- 7,Literals,
- NUMERIC LITERALS may be integers like 3, 1444, 23, and 5280, or real
- 8,Literals,
- numbers like 3.14159, .25, -12, 2.e6, 7E4. Numeric
- 9,Literals,
- literals in a list must be separated by commas; you
- 10,Literals,
- may add spaces after the commas for easier reading.
- 11,Literals,
-
- 12,Literals,
- STRING LITERALS are one or more characters enclosed by apostrophes.
- 13,Literals,
- Use two adjacent apostrophes to write an apostrophe
- 14,Literals,
- in a string. For example: 'You''re a strong, happy
- 15,Literals,
- person, aren''t you?' Note that two apostrophes are
- 16,Literals,
- NOT the same as a "quotation mark"; quotation marks
- 17,Literals,
- are sometimes used to enclose identifier names.
- 18,Literals,
-
- 19,Literals,
- DATE LITERALS are string literals in the date format '09-JAN-42'.
- 20,Literals,
-
- 21,Literals,
- BOOLEAN LITERALS are the predefined constants TRUE, FALSE, and NULL.
- 22,Literals,
-
- 23,Literals,
-
- 24,Literals,
- See also: identifiers, menu.
- 1,Logical Operators,
-
- 2,Logical Operators,
-
- 3,Logical Operators,
- Logical Operators
- 4,Logical Operators,
-
- 5,Logical Operators,
- Logical operators in SQL control the result of multiple conditions.
- 6,Logical Operators,
- The table lists logical operators in the order they are evaluated:
- 7,Logical Operators,
-
- 8,Logical Operators,
- Operator Function Example
- 9,Logical Operators,
- -------------------------------------------------------------------
- 10,Logical Operators,
- NOT Reverses the result of SELECT...WHERE NOT (bal = 0)
- 11,Logical Operators,
- a logical expression
- 12,Logical Operators,
- Exception: NOT (NULL)
- 13,Logical Operators,
- evaluates to null.
- 14,Logical Operators,
-
- 15,Logical Operators,
- AND Returns TRUE if all ...WHERE A >= 1 AND B <= 5000
- 16,Logical Operators,
- conditions are TRUE
- 17,Logical Operators,
-
- 18,Logical Operators,
- OR Returns TRUE if any ...WHERE A IS NULL OR B IS NULL
- 19,Logical Operators,
- conditions are TRUE
- 20,Logical Operators,
-
- 21,Logical Operators,
-
- 22,Logical Operators,
-
- 23,Logical Operators,
- See also: conditions, expressions, boolean comparisons, menu.
- 1,Loops,
-
- 2,Loops,
-
- 3,Loops,
- Loops
- 4,Loops,
-
- 5,Loops,
- PL/SQL provides several forms of iterative control, the ability
- 6,Loops,
- to repeat or skip sections of a block. For details, see:
- 7,Loops,
-
- 8,Loops,
-
- 9,Loops,
- loop (basic loops) end loop example numeric for
- 10,Loops,
-
- 11,Loops,
- while exit plsql example cursor for
- 12,Loops,
-
- 13,Loops,
- numeric for goto
- 14,Loops,
-
- 15,Loops,
- cursor for
- 16,Loops,
-
- 17,Loops,
-
- 18,Loops,
-
- 19,Loops,
- See also: blocks, commands, menu.
- 1,Menu,
- Menu
- 2,Menu,
-
- 3,Menu,
- SQL TOPICS PL/SQL TOPICS FUNCTIONS SQL*PLUS TOPICS
- 4,Menu,
- --------------- ---------------- ---------------- ---------------
- 5,Menu,
- alias attributes 1 row number help
- 6,Menu,
- comments blocks 1 row char commands
- 7,Menu,
- conditions commands conversion old commands
- 8,Menu,
- data dictionary cursors date functions overview
- 9,Menu,
- delimiters error handling error reporting buffer
- 10,Menu,
- expressions examples group functions files
- 11,Menu,
- identifiers loops other functions substitution
- 12,Menu,
- keys scoping rules format dates parameters
- 13,Menu,
- links sql in pl/sql format numbers remote databases
- 14,Menu,
- literals variables format modifiers dba
- 15,Menu,
- nulls limits
- 16,Menu,
- pseudo-columns DATATYPES OPERATORS
- 17,Menu,
- reserved words ---------------- ------------------- ===DIRECTIONS===
- 18,Menu,
- sequences boolean number arithmetic (& char) Type help, a
- 19,Menu,
- synonyms char raw comparison space, and then
- 20,Menu,
- tables date like all or part of
- 21,Menu,
- transactions implicit logical operators a topic name.
- 22,Menu,
- user id long set operators
- 23,Menu,
- views (& indexes) long raw other operators See also: index.
- 1,NEXTVAL,
-
- 2,NEXTVAL,
-
- 3,NEXTVAL,
- NEXTVAL
- 4,NEXTVAL,
-
- 5,NEXTVAL,
- The pseudo-column sequence.NEXTVAL in SQL generates the next number
- 6,NEXTVAL,
- in the sequence specified, while sequence.CURRVAL gives the current
- 7,NEXTVAL,
- number in the sequence. If you use NEXTVAL and CURRVAL for the same
- 8,NEXTVAL,
- sequence in one SELECT statement, you always get the NEXTVAL number.
- 9,NEXTVAL,
- NEXTVAL and CURRVAL:
- 10,NEXTVAL,
-
- 11,NEXTVAL,
- MAY be used within... but may NOT be used...
- 12,NEXTVAL,
- -------------------------------------------------------------------
- 13,NEXTVAL,
- the SELECT list of a SELECT in the SELECT list for a view,
- 14,NEXTVAL,
- statement (except in views) or in a subquery
- 15,NEXTVAL,
-
- 16,NEXTVAL,
- the values list of an INSERT with DISTINCT or set operators
- 17,NEXTVAL,
-
- 18,NEXTVAL,
- the SET expression of UPDATE with ORDER BY, GROUP BY, or
- 19,NEXTVAL,
- HAVING in a SELECT statement.
- 20,NEXTVAL,
-
- 21,NEXTVAL,
-
- 22,NEXTVAL,
- See also: example nextval, pseudo-columns, sequence, select list,
- 23,NEXTVAL,
- select, insert, update, order by, group by, commands, menu.
- 1,NOAUDIT,
-
- 2,NOAUDIT,
-
- 3,NOAUDIT,
- NOAUDIT
- 4,NOAUDIT,
- SQL statement
- 5,NOAUDIT,
- NOAUDIT can be used in two ways: 1) to partially or completely undo a prior
- 6,NOAUDIT,
- system AUDIT, or 2) to partially or completely undo a prior AUDIT statement.
- 7,NOAUDIT,
-
- 8,NOAUDIT,
- *First Method*
- 9,NOAUDIT,
-
- 10,NOAUDIT,
- NOAUDIT system_option, system_option,... | ALL
- 11,NOAUDIT,
- WHENEVER SUCCESSFUL | WHENEVER NOT SUCCESSFUL
- 12,NOAUDIT,
-
- 13,NOAUDIT,
- This type of NOAUDIT partially or completely undoes a prior system AUDIT.
- 14,NOAUDIT,
- This form requires DBA privileges.
- 15,NOAUDIT,
-
- 16,NOAUDIT,
- system_option or ALL
- 17,NOAUDIT,
- is CONNECT, DBA, NOT EXISTS, or RESOURCE. ALL is all options.
- 18,NOAUDIT,
-
- 19,NOAUDIT,
- WHENEVER SUCCESSFUL or WHENEVER NOT SUCCESSFUL
- 20,NOAUDIT,
- turns auditing off for successful or unsuccessful system accesses.
- 21,NOAUDIT,
- If omitted, auditing is turned off for all system accesses.
- 22,NOAUDIT,
-
- 23,NOAUDIT,
- *Second Method*
- 24,NOAUDIT,
-
- 25,NOAUDIT,
- NOAUDIT option, option,... | ALL
- 26,NOAUDIT,
- ON object | DEFAULT
- 27,NOAUDIT,
- WHENEVER SUCCESSFUL | WHENEVER NOT SUCCESSFUL
- 28,NOAUDIT,
-
- 29,NOAUDIT,
- This type of NOAUDIT partially or completely undoes a prior AUDIT statement.
- 30,NOAUDIT,
- You must own the object NOAUDIT operates on. You must have DBA privileges
- 31,NOAUDIT,
- to change the auditing options set for DEFAULT. NOAUDIT also commits the
- 32,NOAUDIT,
- current transaction.
- 33,NOAUDIT,
-
- 34,NOAUDIT,
- option or ALL
- 35,NOAUDIT,
- for tables: ALTER, AUDIT, COMMENT, DELETE, GRANT, INDEX,
- 36,NOAUDIT,
- INSERT, LOCK, RENAME, SELECT, or UPDATE
- 37,NOAUDIT,
-
- 38,NOAUDIT,
- for views: AUDIT, DELETE, GRANT, INSERT, LOCK, RENAME, SELECT,
- 39,NOAUDIT,
- or UPDATE
- 40,NOAUDIT,
-
- 41,NOAUDIT,
- for sequences: ALTER, AUDIT, GRANT, or SELECT
- 42,NOAUDIT,
-
- 43,NOAUDIT,
- for synonyms: the same options as those of their base table/view.
- 44,NOAUDIT,
-
- 45,NOAUDIT,
- ALL means all valid options.
- 46,NOAUDIT,
-
- 47,NOAUDIT,
- object | DEFAULT
- 48,NOAUDIT,
- is a table, view, or sequence you own, or the DEFAULT options for
- 49,NOAUDIT,
- the auditing of new tables.
- 50,NOAUDIT,
-
- 51,NOAUDIT,
- WHENEVER SUCCESSFUL or WHENEVER NOT SUCCESSFUL
- 52,NOAUDIT,
- turns auditing off for successful or unsuccessful table accesses.
- 53,NOAUDIT,
- If omitted, auditing is turned off for all table accesses.
- 54,NOAUDIT,
-
- 55,NOAUDIT,
-
- 56,NOAUDIT,
- See also: audit, grant, commands, menu.
- 1,NOWAIT,
-
- 2,NOWAIT,
-
- 3,NOWAIT,
- NOWAIT
- 4,NOWAIT,
- SQL clauses
- 5,NOWAIT,
- SELECT list... FROM...
- 6,NOWAIT,
- FOR UPDATE OF column, column,... NOWAIT; --one column is required
- 7,NOWAIT,
-
- 8,NOWAIT,
- LOCK TABLE [user.]table [,[user.]table]...
- 9,NOWAIT,
- IN lockmode MODE [NOWAIT]
- 10,NOWAIT,
-
- 11,NOWAIT,
- NOWAIT is used in the SELECT and LOCK TABLE statements. When used in
- 12,NOWAIT,
- the SELECT statement, NOWAIT specifies that ORACLE should not wait for
- 13,NOWAIT,
- the row if the row has already been locked by another user. Instead,
- 14,NOWAIT,
- ORACLE will return control to the user. When used in the LOCK TABLE
- 15,NOWAIT,
- statement, NOWAIT specifies that ORACLE should not wait for the table
- 16,NOWAIT,
- if the table has already been locked by another user. (ORACLE will
- 17,NOWAIT,
- return control to the user.)
- 18,NOWAIT,
-
- 19,NOWAIT,
- See also: for update of, lock table, select, example delete, commit,
- 20,NOWAIT,
- rollback, insert, delete, commands, menu.
- 1,NULL,
-
- 2,NULL,
-
- 3,NULL,
- NULL
- 4,NULL,
- PL/SQL statement
- 5,NULL,
- NULL;
- 6,NULL,
-
- 7,NULL,
- The NULL statement is optional, and has no effect on block processing.
- 8,NULL,
- Use it to make conditional statements easier to read. Some examples:
- 9,NULL,
-
- 10,NULL,
- EXCEPTION IF job_title = 'DESIGNER' THEN
- 11,NULL,
- WHEN VALUE ERROR THEN GOTO calc_bonus;
- 12,NULL,
- INSERT INTO parts_table ELSE
- 13,NULL,
- VALUES ('ZZ', 9999); NULL;
- 14,NULL,
- WHEN OTHERS THEN END IF;
- 15,NULL,
- NULL;
- 16,NULL,
-
- 17,NULL,
-
- 18,NULL,
- The NULL statement has nothing at all to do with null values; IS NULL
- 19,NULL,
- and IS NOT NULL are Comparison Operators.
- 20,NULL,
-
- 21,NULL,
-
- 22,NULL,
- See also: nulls, comparison (operators), conditions, commands, menu.
- 1,NUMBER,
-
- 2,NUMBER,
-
- 3,NUMBER,
- NUMBER
- 4,NUMBER,
-
- 5,NUMBER,
- NUMBER(precision, scale) --(precision, scale) optional
- 6,NUMBER,
-
- 7,NUMBER,
- The NUMBER datatype stores numeric data. When declaring a column
- 8,NUMBER,
- to be a NUMBER you can specify the total number of digits allowed
- 9,NUMBER,
- (precision), and the number of digits permitted after the decimal
- 10,NUMBER,
- point (scale). If a value has more digits than the number allowed,
- 11,NUMBER,
- the error message "exceeds precision" is returned. Any value with
- 12,NUMBER,
- more decimal digits than allowed is rounded.
- 13,NUMBER,
-
- 14,NUMBER,
- When scale is a negative number, an incoming value is rounded to
- 15,NUMBER,
- that number of places LEFT of the decimal point. If precision is
- 16,NUMBER,
- specified and scale is omitted, the incoming value is rounded to
- 17,NUMBER,
- a whole number. If precision is omitted, the value is stored as
- 18,NUMBER,
- is, to the limit of the system's maximum precision and scale.
- 19,NUMBER,
-
- 20,NUMBER,
-
- 21,NUMBER,
- See also: conversion, variables, char, long, date, raw, boolean, menu.
- 1,Nulls,
-
- 2,Nulls,
-
- 3,Nulls,
- Nulls
- 4,Nulls,
-
- 5,Nulls,
- A null specifies that data is unknown, missing, or not applicable.
- 6,Nulls,
- Columns of any datatype may contain null values, unless the column
- 7,Nulls,
- was defined as NOT NULL when the table was created.
- 8,Nulls,
-
- 9,Nulls,
- A null value is appropriate when the actual value is not known, or
- 10,Nulls,
- when a data value would be meaningless. Null is not the same as a
- 11,Nulls,
- value of zero. An expression that contains null evaluates to null.
- 12,Nulls,
-
- 13,Nulls,
- Use the NVL function to temporarily convert a null value to a data
- 14,Nulls,
- value. NVL(comm, 0) returns the value of comm if comm is not null,
- 15,Nulls,
- or 0 if comm is null.
- 16,Nulls,
-
- 17,Nulls,
- In comparing a null value, use IS or IS NOT as the operator; using
- 18,Nulls,
- any other comparison operator on a null value always returns null.
- 19,Nulls,
-
- 20,Nulls,
- Group functions ignore null values.
- 21,Nulls,
-
- 22,Nulls,
-
- 23,Nulls,
- See also: example nulls, null (statement), other functions (NVL),
- 24,Nulls,
- group functions, comparison (operators), menu.
- 1,Numeric FOR,
-
- 2,Numeric FOR,
-
- 3,Numeric FOR,
- Numeric FOR
- 4,Numeric FOR,
- PL/SQL statement
- 5,Numeric FOR,
-
- 6,Numeric FOR,
- FOR index IN first_integer..second_integer LOOP
- 7,Numeric FOR,
- sequence_of_statements
- 8,Numeric FOR,
- END LOOP;
- 9,Numeric FOR,
-
- 10,Numeric FOR,
- FOR index IN REVERSE first_integer..second_integer LOOP
- 11,Numeric FOR,
- sequence_of_statements
- 12,Numeric FOR,
- END LOOP;
- 13,Numeric FOR,
-
- 14,Numeric FOR,
- A numeric FOR loop's sequence_of_statements is executed once for each
- 15,Numeric FOR,
- integer in the range between the first and second integers. Starting
- 16,Numeric FOR,
- with the first_integer, index is incremented by one at each iteration
- 17,Numeric FOR,
- until index exceeds the second_integer and ends the loop. IN REVERSE
- 18,Numeric FOR,
- starts index with the second_integer. Index is implicitly declared to
- 19,Numeric FOR,
- be a NUMBER, visible only in the loop, and treated as a constant: you
- 20,Numeric FOR,
- can use its current value, but you can't change it.
- 21,Numeric FOR,
-
- 22,Numeric FOR,
-
- 23,Numeric FOR,
- For other loops see: loop, while, cursor for.
- 24,Numeric FOR,
- See also: example numeric for, number, commands, menu.
- 1,OPEN,
-
- 2,OPEN,
- OPEN
- 3,OPEN,
- PL/SQL statement
- 4,OPEN,
- OPEN cursor
- 5,OPEN,
- (parameter1_value, parameter2_value...); --optional
- 6,OPEN,
-
- 7,OPEN,
-
- 8,OPEN,
- OPEN evaluates the query associated with cursor, which must have
- 9,OPEN,
- been previously declared. If the DECLARE CURSOR lists parameters,
- 10,OPEN,
- the OPEN statement must list values for the parameters following
- 11,OPEN,
- the cursor name.
- 12,OPEN,
-
- 13,OPEN,
-
- 14,OPEN,
-
- 15,OPEN,
- See also: example cursors, cursors, declare cursor, close,
- 16,OPEN,
- commands, menu.
- 1,ORDER BY,
-
- 2,ORDER BY,
-
- 3,ORDER BY,
- ORDER BY
- 4,ORDER BY,
- SQL clause
- 5,ORDER BY,
- SELECT ... SELECT ...
- 6,ORDER BY,
- ORDER BY expr ASC,... ORDER BY expr DESC,...
- 7,ORDER BY,
-
- 8,ORDER BY,
- ORDER BY position ASC,... ORDER BY position DESC,...
- 9,ORDER BY,
-
- 10,ORDER BY,
- The ORDER BY clause specifies the order in which to display the
- 11,ORDER BY,
- results of a query. Expr references one or more SELECT clause
- 12,ORDER BY,
- columns or FROM clause tables. Position is a number indicating
- 13,ORDER BY,
- the place of a column in the SELECT clause. ASC or DESC specify
- 14,ORDER BY,
- ascending or descending order for the sort; the default is ASC.
- 15,ORDER BY,
-
- 16,ORDER BY,
- ORDER BY cannot be used in subqueries of INSERT, UPDATE, CREATE
- 17,ORDER BY,
- TABLE or CREATE VIEW statements. An ORDER BY cancels the effect
- 18,ORDER BY,
- of a CONNECT BY clause in the same statement.
- 19,ORDER BY,
-
- 20,ORDER BY,
-
- 21,ORDER BY,
- See also: example date functions, select, query, subquery, insert,
- 22,ORDER BY,
- update, create table, create view, connect by, menu.
- 1,Old Commands,
-
- 2,Old Commands,
-
- 3,Old Commands,
- Old Commands
- 4,Old Commands,
-
- 5,Old Commands,
- These old SQL*Plus commands still work, although SQL*Plus provides newer
- 6,Old Commands,
- commands with better functionality.
- 7,Old Commands,
-
- 8,Old Commands,
-
- 9,Old Commands,
- BTI[TLE] text
- 10,Old Commands,
- BTITLE displays a title at the bottom of each report page. The old
- 11,Old Commands,
- form of BTITLE offers more limited formatting than the new form, but
- 12,Old Commands,
- provides compatibility with UFI (a predecessor of SQL*Plus). The old
- 13,Old Commands,
- form defines the bottom title as an empty line followed by a line with
- 14,Old Commands,
- centered text. See OLD TTITLE for details.
- 15,Old Commands,
-
- 16,Old Commands,
-
- 17,Old Commands,
- COL[UMN] {column|expr} DEF[AULT] Replaced by: COLUMN CLEAR
- 18,Old Commands,
- COLUMN DEFAULT resets the display attributes for a given column to
- 19,Old Commands,
- default values. It has the same effect as COLUMN CLEAR.
- 20,Old Commands,
-
- 21,Old Commands,
-
- 22,Old Commands,
- DOC[UMENT] Replaced by: REMARK
- 23,Old Commands,
- DOCUMENT begins a block of documentation in a command file.
- 24,Old Commands,
- When you type DOCUMENT and press RETURN, SQL*Plus displays DOC> in
- 25,Old Commands,
- place of SQL> until you end the documentation. Enter # (pound) on a
- 26,Old Commands,
- line by itself to end the documentation. If DOCUMENT is OFF, SQL*Plus
- 27,Old Commands,
- reads further lines of documentation as commands. See SET DOCUMENT.
- 28,Old Commands,
-
- 29,Old Commands,
-
- 30,Old Commands,
- NEWPAGE [1|n] Replaced by: SET command's NEWPAGE
- 31,Old Commands,
- NEWPAGE advances spooled output n lines beyond the beginning of the
- 32,Old Commands,
- next page.
- 33,Old Commands,
-
- 34,Old Commands,
-
- 35,Old Commands,
- SET BUF[FER] {buffer|SQL}
- 36,Old Commands,
- SET BUFFER makes the specified buffer the current buffer. Initially,
- 37,Old Commands,
- the SQL buffer is the current buffer. SQL*Plus doesn't use multiple
- 38,Old Commands,
- buffers; the SQL buffer should meet your needs. If the buffer name
- 39,Old Commands,
- you enter does not already exist, SET BUFFER creates and names the
- 40,Old Commands,
- buffer. The buffer is erased when you exit SQL*Plus.
- 41,Old Commands,
-
- 42,Old Commands,
- Running a query automatically makes the SQL buffer the current one.
- 43,Old Commands,
- GET and SAVE copy text from one buffer to another. CLEAR BUFFER
- 44,Old Commands,
- erases text from the current buffer. CLEAR SQL erases text from the
- 45,Old Commands,
- SQL buffer when you're using another one.
- 46,Old Commands,
-
- 47,Old Commands,
-
- 48,Old Commands,
- SET DOC[UMENT] {OFF|ON}
- 49,Old Commands,
- SET DOCUMENT ON enables the DOCUMENT command, and SET DOCUMENT OFF
- 50,Old Commands,
- disables it. If you disable DOCUMENT, SQL*Plus reads any lines after
- 51,Old Commands,
- a DOCUMENT command as commands. See DOCUMENT for details.
- 52,Old Commands,
-
- 53,Old Commands,
-
- 54,Old Commands,
- SET TRU[NCATE] {OFF|ON}
- 55,Old Commands,
- SET TRUNCATE controls whether SQL*Plus truncates or wraps a data item
- 56,Old Commands,
- that is too long for the current line width. ON and SET WRAP OFF work
- 57,Old Commands,
- the same way. You may prefer to use WRAP, because the SHOW command
- 58,Old Commands,
- recognizes WRAP and does not recognize TRUNCATE.
- 59,Old Commands,
-
- 60,Old Commands,
-
- 61,Old Commands,
- TTI[TLE] text
- 62,Old Commands,
- TTITLE displays a title at the top of each report page. The old form
- 63,Old Commands,
- of TTITLE has more limited formatting than the new form, but is
- 64,Old Commands,
- compatible with UFI, a SQL*Plus predecessor. The old form defines the
- 65,Old Commands,
- top title as a line with the date left-aligned and the page number
- 66,Old Commands,
- right-aligned, a line with centered text, and then a blank line. Text
- 67,Old Commands,
- is the title displayed.
- 68,Old Commands,
-
- 69,Old Commands,
- SQL*Plus centers text based on the SET LINESIZE setting. A separator
- 70,Old Commands,
- character (|) begins a new line; two line separator characters (||)
- 71,Old Commands,
- insert a blank line. Use SET HEADSEP to change the line separator
- 72,Old Commands,
- character. Control the formatting of page numbers in the old forms of
- 73,Old Commands,
- TTITLE and BTITLE by defining the variable "_page". The default _page
- 74,Old Commands,
- value is the formatting string, "page &P4". To alter it, DEFINE _page
- 75,Old Commands,
- with a new string:
- 76,Old Commands,
-
- 77,Old Commands,
- SQL> SET ESCAPE /SQL> DEFINE _page = 'Page /&P2'
- 78,Old Commands,
-
- 79,Old Commands,
- The string prints "Page" and formats the page number to a width of 2.
- 80,Old Commands,
- You can substitute any text for "Page" and any number for the width.
- 81,Old Commands,
- You must set Escape so SQL*Plus doesn't read the ampersand (&) as a
- 82,Old Commands,
- substitution variable. The SET command's ESCAPE variable sets the
- 83,Old Commands,
- escape character.
- 84,Old Commands,
-
- 85,Old Commands,
- SQL*Plus interprets TTITLE in the old form if a valid new-form clause
- 86,Old Commands,
- does not immediately follow the command name.
- 87,Old Commands,
-
- 88,Old Commands,
- Example: To use the old TTITLE to set a top title with a left-aligned
- 89,Old Commands,
- date and a right-aligned page number on one line, MARKETING
- 90,Old Commands,
- on the next line, and PERSONNEL REPORT on the third, enter:
- 91,Old Commands,
-
- 92,Old Commands,
- SQL> TTITLE 'MARKETING | PERSONNEL REPORT'
- 93,Old Commands,
-
- 94,Old Commands,
- See also: commands, menu.
- 1,Other Functions,
-
- 2,Other Functions,
-
- 3,Other Functions,
- Other Functions
- 4,Other Functions,
-
- 5,Other Functions,
- DECODE(expr, search1, result1, Returns result1 if expr = search1,
- 6,Other Functions,
- search2, result2,...default) result2 if expr = search2, etc. If
- 7,Other Functions,
- no match is found, returns default
- 8,Other Functions,
- or null if default omitted.
- 9,Other Functions,
-
- 10,Other Functions,
- DUMP(expr, format, start_with, Shows format of expr as 8=octal,
- 11,Other Functions,
- length) 10=decimal, 16=hex, 17=character;
- 12,Other Functions,
- start_position and length set the
- 13,Other Functions,
- part shown; omit to show entirely.
- 14,Other Functions,
-
- 15,Other Functions,
- GREATEST(expr1, expr2, expr3...) Returns greatest expr value in the
- 16,Other Functions,
- list, converted to expr1 datatype.
- 17,Other Functions,
-
- 18,Other Functions,
- LEAST(expr1, expr2, expr3...) Returns least expr value in list,
- 19,Other Functions,
- converted to expr1 datatype.
- 20,Other Functions,
-
- 21,Other Functions,
- DUMP, GREATEST, and LEAST are not available in PL/SQL.
- 22,Other Functions,
-
- 23,Other Functions,
-
- 24,Other Functions,
- NVL(expr1, expr2) Returns expr1 if not null; if null, returns
- 25,Other Functions,
- expr2. Returned datatype must match expr1.
- 26,Other Functions,
-
- 27,Other Functions,
- UID Returns the unique integer identifier of each user.
- 28,Other Functions,
-
- 29,Other Functions,
- USER Returns the currently signed on username.
- 30,Other Functions,
-
- 31,Other Functions,
- USERENV('ENTRYID') Returns available auditing entry identifier.
- 32,Other Functions,
-
- 33,Other Functions,
- USERENV('LANGUAGE') Returns language set by LANGUAGE INIT.ORA.
- 34,Other Functions,
-
- 35,Other Functions,
- USERENV('SESSIONID') Returns user's auditing session identifier.
- 36,Other Functions,
-
- 37,Other Functions,
- USERENV('TERMINAL') Returns terminal's operating system identifier.
- 38,Other Functions,
-
- 39,Other Functions,
- VSIZE(expr) Returns the number of bytes used to store the
- 40,Other Functions,
- ORACLE internal representation of expr.
- 41,Other Functions,
-
- 42,Other Functions,
-
- 43,Other Functions,
- See also: expressions, null, user id, menu.
- 1,Other Operators,
-
- 2,Other Operators,
-
- 3,Other Operators,
- Other Operators
- 4,Other Operators,
-
- 5,Other Operators,
- Operator Meaning or Function in SQL
- 6,Other Operators,
- --------------------------------------------------------------------------
- 7,Other Operators,
- (+) The preceding column is the outer join column in a join.
- 8,Other Operators,
-
- 9,Other Operators,
- * Selects all columns from the table in a query.
- 10,Other Operators,
-
- 11,Other Operators,
- table.* Selects all columns from the specified table in a query.
- 12,Other Operators,
-
- 13,Other Operators,
- ALL Returns duplicate values from a query or aggregation.
- 14,Other Operators,
-
- 15,Other Operators,
- DISTINCT Eliminates duplicate values from the result of a query
- 16,Other Operators,
- or from an aggregate expression. The default is ALL.
- 17,Other Operators,
-
- 18,Other Operators,
- PRIOR Used in the START WITH clause of a tree-structured query
- 19,Other Operators,
- to define the adjacent term as parent of the other term.
- 20,Other Operators,
-
- 21,Other Operators,
-
- 22,Other Operators,
-
- 23,Other Operators,
- See also: outer join, select, query, tree-structured query, menu.
- 1,Outer Join,
-
- 2,Outer Join,
-
- 3,Outer Join,
- Outer Join
- 4,Outer Join,
-
- 5,Outer Join,
- SELECT ...
- 6,Outer Join,
- FROM table1, table2, ...
- 7,Outer Join,
- WHERE table1.column = table2.column (+)
- 8,Outer Join,
-
- 9,Outer Join,
-
- 10,Outer Join,
- The outer join operator (+) extends the result of a normal join by
- 11,Outer Join,
- returning all rows with matching columns from the two tables, plus
- 12,Outer Join,
- any non-matching rows from the table.column with (+) following it.
- 13,Outer Join,
-
- 14,Outer Join,
- You may outer join a table to only one other table within a single
- 15,Outer Join,
- SELECT statement.
- 16,Outer Join,
-
- 17,Outer Join,
-
- 18,Outer Join,
-
- 19,Outer Join,
- See also: example outer join, select, uses of select, menu.
- 1,Overview,
-
- 2,Overview,
-
- 3,Overview,
- Overview (SQL*Plus)
- 4,Overview,
-
- 5,Overview,
- You can use SQL*Plus with SQL and its procedural extension, PL/SQL. SQL
- 6,Overview,
- enables you to store and retrieve data in the ORACLE relational database
- 7,Overview,
- management system. SQL*Plus enables you to manipulate SQL commands and
- 8,Overview,
- PL/SQL blocks, and to perform many other tasks. With SQL*Plus, you can:
- 9,Overview,
-
- 10,Overview,
- - enter, edit, store, retrieve, and run SQL commands and PL/SQL blocks
- 11,Overview,
- - format, perform calculations on, store, and print query results
- 12,Overview,
- - list column definitions for any table
- 13,Overview,
- - access and copy data between SQL databases
- 14,Overview,
- - send messages to and accept responses from an end user
- 15,Overview,
-
- 16,Overview,
-
- 17,Overview,
- Basic SQL*Plus Concepts
- 18,Overview,
-
- 19,Overview,
- Command - An instruction you give SQL*Plus or the ORACLE
- 20,Overview,
- RDBMS.
- 21,Overview,
-
- 22,Overview,
- Block - A group of SQL and PL/SQL commands related to
- 23,Overview,
- one another through procedural logic.
- 24,Overview,
-
- 25,Overview,
- Table - The basic unit of storage in the ORACLE RDBMS.
- 26,Overview,
-
- 27,Overview,
- Query - A SELECT statement that retrieves information
- 28,Overview,
- from one or more tables.
- 29,Overview,
-
- 30,Overview,
- Query results - The data retrieved by a query.
- 31,Overview,
-
- 32,Overview,
- Report - Query results formatted by you with SQL*Plus
- 33,Overview,
- commands.
- 34,Overview,
-
- 35,Overview,
- Entering and Executing Commands
- 36,Overview,
-
- 37,Overview,
- Your computer's cursor (usually an underline, rectangular block, or slash)
- 38,Overview,
- appears after the command prompt. The cursor is where the next character
- 39,Overview,
- you type appears on the screen. You can enter commands in uppercase or
- 40,Overview,
- lowercase in SQL*Plus. As you type SQL*Plus, SQL, and PL/SQL commands,
- 41,Overview,
- use at least one space, tab, or RETURN between words. You can use extra
- 42,Overview,
- spaces, tabs, and RETURNs between words to make the code easier to read.
- 43,Overview,
-
- 44,Overview,
- You can enter three kinds of commands at the command prompt:
- 45,Overview,
-
- 46,Overview,
- - SQL commands, for working with information in the database
- 47,Overview,
- - PL/SQL blocks, also for working with information in the database
- 48,Overview,
- - SQL*Plus commands for formatting query results, setting options,
- 49,Overview,
- and editing and storing SQL and PL/SQL commands
- 50,Overview,
-
- 51,Overview,
- End a SQL command with a ; (semicolon) at the end of a line
- 52,Overview,
- a / (slash) on a line by itself
- 53,Overview,
- a blank line
- 54,Overview,
-
- 55,Overview,
- A semicolon (;) tells SQL*Plus to run the command. Type ; at the end of
- 56,Overview,
- the last line and press RETURN to execute. If you press RETURN without
- 57,Overview,
- a semicolon, SQL*Plus displays the next line number. Type ; and press
- 58,Overview,
- RETURN again to run the command. A slash (/) on a line by itself also
- 59,Overview,
- tells SQL*Plus to run the command. Press RETURN after the last command
- 60,Overview,
- line. At the next line number, type / and press RETURN again.
- 61,Overview,
-
- 62,Overview,
-
- 63,Overview,
- Running PL/SQL Blocks
- 64,Overview,
-
- 65,Overview,
- PL/SQL blocks begin with DECLARE, BEGIN, or a block name. SQL*Plus treats
- 66,Overview,
- PL/SQL blocks the same as SQL commands, except that a semicolon (;) or a
- 67,Overview,
- blank line does not terminate and execute a block; terminate PL/SQL blocks
- 68,Overview,
- by entering a period (.) by itself on a new line. To execute the block
- 69,Overview,
- currently in the SQL buffer, use the RUN or / (slash) command.
- 70,Overview,
-
- 71,Overview,
- Example: You might enter and run the following PL/SQL block:
- 72,Overview,
-
- 73,Overview,
- SQL> DECLARE
- 74,Overview,
- 2 x NUMBER := 100;
- 75,Overview,
- 3 BEGIN
- 76,Overview,
- 4 FOR i IN 1..10 LOOP
- 77,Overview,
- 5 IF TRUNC(i / 2) = i / 2 THEN --i is even
- 78,Overview,
- 6 INSERT INTO temp VALUES (i, x, 'i is even');
- 79,Overview,
- 7 ELSE
- 80,Overview,
- 8 INSERT INTO temp VALUES (i, x, 'i is odd');
- 81,Overview,
- 9 END IF;
- 82,Overview,
- 10 x := x + 100;
- 83,Overview,
- 11 END LOOP;
- 84,Overview,
- 12 END;
- 85,Overview,
- 13 .
- 86,Overview,
-
- 87,Overview,
- SQL> PL/SQL procedure successfully completed.
- 88,Overview,
-
- 89,Overview,
- When you run a block, SQL commands within the block may behave
- 90,Overview,
- somewhat differently than they would outside of the block.
- 91,Overview,
-
- 92,Overview,
-
- 93,Overview,
- Running SQL*Plus Commands
- 94,Overview,
-
- 95,Overview,
- Use SQL*Plus commands to manipulate SQL commands and PL/SQL blocks, and
- 96,Overview,
- format and print query results. To speed up command entry, you can
- 97,Overview,
- abbreviate many SQL*Plus commands to one or a few letters.
- 98,Overview,
-
- 99,Overview,
-
- 100,Overview,
- Running Host Operating System Commands
- 101,Overview,
-
- 102,Overview,
- You can execute a host operating system command from the SQL*Plus command
- 103,Overview,
- prompt, useful when you want to perform a task like listing host operating
- 104,Overview,
- system files. To run a host operating system command, enter HOST followed
- 105,Overview,
- by the host operating system command. For example, this SQL*Plus command
- 106,Overview,
- runs a host command, DIRECTORY *.SQL:
- 107,Overview,
-
- 108,Overview,
- SQL> HOST DIRECTORY *.SQL
- 109,Overview,
-
- 110,Overview,
- See also: commands, menu.
- 1,PAUSE,
-
- 2,PAUSE,
-
- 3,PAUSE,
- PAUSE
- 4,PAUSE,
-
- 5,PAUSE,
- PAU[SE] [ text ]
- 6,PAUSE,
-
- 7,PAUSE,
- PAUSE displays an empty line followed by a line with text, then waits for
- 8,PAUSE,
- the user to press RETURN. Or it displays two empty lines, and waits for
- 9,PAUSE,
- the user's response.
- 10,PAUSE,
-
- 11,PAUSE,
- text
- 12,PAUSE,
- is the text you wish to display. Enter PAUSE with no text to
- 13,PAUSE,
- display two empty lines.
- 14,PAUSE,
-
- 15,PAUSE,
-
- 16,PAUSE,
- Since PAUSE waits for the user's response, it's wise to include a message
- 17,PAUSE,
- to press RETURN. PAUSE reads input from the terminal (if available) even
- 18,PAUSE,
- when you specify a file as the source of the input. The SET command's
- 19,PAUSE,
- PAUSE clause controls pausing between pages of a report.
- 20,PAUSE,
-
- 21,PAUSE,
-
- 22,PAUSE,
- Example: To display "Adjust paper and press RETURN to continue." then
- 23,PAUSE,
- wait for the user to press RETURN, include the following PAUSE
- 24,PAUSE,
- command in a command file:
- 25,PAUSE,
-
- 26,PAUSE,
- SQL> GET MYFILE
- 27,PAUSE,
- 1 SET PAUSE ON
- 28,PAUSE,
- 2 PAUSE Adjust paper and press RETURN to continue.
- 29,PAUSE,
- 3 SELECT ...
- 30,PAUSE,
-
- 31,PAUSE,
-
- 32,PAUSE,
- See also: /, @, get, prompt, run, set (pause), start, commands, menu.
- 1,PL/SQL Exceptions,
-
- 2,PL/SQL Exceptions,
-
- 3,PL/SQL Exceptions,
- PL/SQL Exceptions
- 4,PL/SQL Exceptions,
-
- 5,PL/SQL Exceptions,
- Predefined SQLCODE ORACLE
- 6,PL/SQL Exceptions,
- PL/SQL Exception Returns ErrorCode Exception Raised When
- 7,PL/SQL Exceptions,
- ----------------------------------------------------------------------------
- 8,PL/SQL Exceptions,
- DUP_VAL_ON_INDEX -1 ORA-00001 INSERT/UPDATE tried to create two
- 9,PL/SQL Exceptions,
- rows w/ dup values in UNIQUE cols
- 10,PL/SQL Exceptions,
- INVALID_CURSOR -1001 ORA-01001 Stmt specified an invalid cursor
- 11,PL/SQL Exceptions,
- INVALID_NUMBER -1722 ORA-01722 CHAR to NUMBER failed: not number
- 12,PL/SQL Exceptions,
- LOGIN_DENIED -1017 ORA-01017 Invalid username/password used
- 13,PL/SQL Exceptions,
- NO_DATA_FOUND +100 ORA-01403 SELECT returned zero rows
- 14,PL/SQL Exceptions,
- NOT_LOGGED_ON -1012 ORA-01012 ORACLE call without ORACLE logon
- 15,PL/SQL Exceptions,
- PROGRAM_ERROR -6501 ORA-06501 PL/SQL had an internal problem
- 16,PL/SQL Exceptions,
- STORAGE_ERROR -6500 ORA-06500 PL/SQL memory full or corrupted
- 17,PL/SQL Exceptions,
- TIMEOUT_ON_RESOURCE -51 ORA-00051 Resource not available in time
- 18,PL/SQL Exceptions,
- TOO_MANY_ROWS -1427 ORA-01427 SELECT returned more than one row
- 19,PL/SQL Exceptions,
- VALUE_ERROR -6502 ORA-06502 Arith/num/string/conversion error
- 20,PL/SQL Exceptions,
- ZERO_DIVIDE -1476 ORA-01476 Attempted to divide a number by 0
- 21,PL/SQL Exceptions,
-
- 22,PL/SQL Exceptions,
-
- 23,PL/SQL Exceptions,
- See also: exception, error reporting (functions), insert, update, char,
- 24,PL/SQL Exceptions,
- number, user id, select, error handling, menu.
- 1,PRAGMA EXCEPTION_INIT,
-
- 2,PRAGMA EXCEPTION_INIT,
-
- 3,PRAGMA EXCEPTION_INIT,
- PRAGMA EXCEPTION_INIT
- 4,PRAGMA EXCEPTION_INIT,
- PL/SQL statement
- 5,PRAGMA EXCEPTION_INIT,
-
- 6,PRAGMA EXCEPTION_INIT,
- PRAGMA EXCEPTION_INIT(exception_name, error_code_number);
- 7,PRAGMA EXCEPTION_INIT,
-
- 8,PRAGMA EXCEPTION_INIT,
-
- 9,PRAGMA EXCEPTION_INIT,
- PRAGMA EXCEPTION_INIT enables you to assign a name to the error
- 10,PRAGMA EXCEPTION_INIT,
- code of an internal exception that has not been named by ORACLE.
- 11,PRAGMA EXCEPTION_INIT,
-
- 12,PRAGMA EXCEPTION_INIT,
- The exception_name must be listed in the DECLARE section of the
- 13,PRAGMA EXCEPTION_INIT,
- current block or an enclosing block. Assign one exception_name
- 14,PRAGMA EXCEPTION_INIT,
- only to a particular error code.
- 15,PRAGMA EXCEPTION_INIT,
-
- 16,PRAGMA EXCEPTION_INIT,
- Error_code_numbers are those returned by the SQLCODE function.
- 17,PRAGMA EXCEPTION_INIT,
-
- 18,PRAGMA EXCEPTION_INIT,
- The keyword PRAGMA conveys the statement to the PL/SQL compiler;
- 19,PRAGMA EXCEPTION_INIT,
- the statement is not processed when the block is executed.
- 20,PRAGMA EXCEPTION_INIT,
-
- 21,PRAGMA EXCEPTION_INIT,
-
- 22,PRAGMA EXCEPTION_INIT,
- See also: error handling, declare, exception, pl/sql exceptions,
- 23,PRAGMA EXCEPTION_INIT,
- error reporting (functions), commands, menu.
- 1,PROMPT,
-
- 2,PROMPT,
-
- 3,PROMPT,
- PROMPT
- 4,PROMPT,
-
- 5,PROMPT,
- PROMPT [ text ]
- 6,PROMPT,
-
- 7,PROMPT,
- PROMPT sends the specified message or a blank line to the user's screen.
- 8,PROMPT,
-
- 9,PROMPT,
- text
- 10,PROMPT,
- is the text of the message you wish to display. If you omit text,
- 11,PROMPT,
- PROMPT displays a blank line on the user's screen.
- 12,PROMPT,
-
- 13,PROMPT,
- Use this command in command files to give information to the user.
- 14,PROMPT,
-
- 15,PROMPT,
- Example: Here is PROMPT used with ACCEPT in command file ASKFORDEPT:
- 16,PROMPT,
-
- 17,PROMPT,
- SQL> GET ASKFORDEPT
- 18,PROMPT,
- 1 PROMPT
- 19,PROMPT,
- 2 PROMPT Please enter a department
- 20,PROMPT,
- 3 PROMPT For example: 10, 20, 30, 40
- 21,PROMPT,
- 4 ACCEPT NEWDEPT NUMBER PROMPT 'DEPT:>'
- 22,PROMPT,
- 5* SELECT DNAME FROM DEPT WHERE DEPTNO = &NEWDEPT
- 23,PROMPT,
-
- 24,PROMPT,
- If you run the file using @ASKFORDEPT, SQL*Plus displays:
- 25,PROMPT,
-
- 26,PROMPT,
- Please enter a department
- 27,PROMPT,
- For example: 10, 20, 30, 40
- 28,PROMPT,
- DEPT:>
- 29,PROMPT,
-
- 30,PROMPT,
- You can then enter a department number at the DEPT:> prompt.
- 31,PROMPT,
- SQL*Plus lists the line containing &NEWDEPT before and after
- 32,PROMPT,
- substitution, and then displays the department name matching
- 33,PROMPT,
- the number entered at the DEPT:> prompt.
- 34,PROMPT,
-
- 35,PROMPT,
-
- 36,PROMPT,
- See also: /, @, accept, get, input, pause, run, start, commands, menu.
- 1,Parameters,
-
- 2,Parameters,
-
- 3,Parameters,
- Parameters
- 4,Parameters,
-
- 5,Parameters,
- A parameter is a substitution variable with & (ampersand) followed by a
- 6,Parameters,
- number (for example, "&1"). Parameters are used only in command files.
- 7,Parameters,
- You pass values to the parameters as arguments to the START command. If a
- 8,Parameters,
- parameter represents a char or date value, enclose the parameter in
- 9,Parameters,
- apostrophes as if it were a constant:
- 10,Parameters,
-
- 11,Parameters,
- SELECT * FROM EMP
- 12,Parameters,
- WHERE JOB='&1' /*char value*/
- 13,Parameters,
- AND SAL=&2; /*number value*/
- 14,Parameters,
-
- 15,Parameters,
- Then, when you run the command file, enter parameter values as arguments
- 16,Parameters,
- of the START command. The first argument after the file name represents
- 17,Parameters,
- the first parameter (&1), the second represents the second parameter (&2),
- 18,Parameters,
- and so on. In the following command, SQL*Plus substitutes CLERK for &1
- 19,Parameters,
- and 7900 for &2:
- 20,Parameters,
-
- 21,Parameters,
- SQL> START MYFILE CLERK 7900
- 22,Parameters,
-
- 23,Parameters,
- When you use arguments with the START command, SQL*Plus DEFINEs each
- 24,Parameters,
- parameter in the command file with the value of the appropriate argument.
- 25,Parameters,
-
- 26,Parameters,
- See also: substitution, restrictions, commands, menu.
- 1,Pseudo-Columns,
-
- 2,Pseudo-Columns,
-
- 3,Pseudo-Columns,
- Pseudo-Columns
- 4,Pseudo-Columns,
-
- 5,Pseudo-Columns,
- A pseudo-column in SQL acts like a column, but doesn't reside in a
- 6,Pseudo-Columns,
- table. Queries can access data in a pseudo-column, but you cannot
- 7,Pseudo-Columns,
- INSERT, UPDATE, or DELETE a pseudo-column.
- 8,Pseudo-Columns,
-
- 9,Pseudo-Columns,
- Pseudo-Column Returns
- 10,Pseudo-Columns,
- ---------------------------------------------------------------------
- 11,Pseudo-Columns,
- sequence.NEXTVAL the next value in the sequence
- 12,Pseudo-Columns,
-
- 13,Pseudo-Columns,
- sequence.CURRVAL the current value in the sequence
- 14,Pseudo-Columns,
-
- 15,Pseudo-Columns,
- ROWID a row's unique identifier
- 16,Pseudo-Columns,
-
- 17,Pseudo-Columns,
- ROWNUM the numeric order in which a row was selected
- 18,Pseudo-Columns,
- from a table or from a set of joined rows
- 19,Pseudo-Columns,
-
- 20,Pseudo-Columns,
- LEVEL 1= root, 2= root's child, 3= grandchild, etc.
- 21,Pseudo-Columns,
-
- 22,Pseudo-Columns,
-
- 23,Pseudo-Columns,
- See also: query, nextval, example nextval, tree-structured query,
- 24,Pseudo-Columns,
- sequences, menu.
- 1,QUIT,
-
- 2,QUIT,
-
- 3,QUIT,
- QUIT
- 4,QUIT,
-
- 5,QUIT,
- {QUIT | EXIT} [SUCCESS | FAILURE | WARNING | n | variable]
- 6,QUIT,
-
- 7,QUIT,
- QUIT commits all pending database changes, leaves SQL*Plus, and returns
- 8,QUIT,
- control to the operating system.
- 9,QUIT,
-
- 10,QUIT,
- QUIT or EXIT
- 11,QUIT,
- can be used interchangeably.
- 12,QUIT,
-
- 13,QUIT,
- SUCCESS
- 14,QUIT,
- exits normally.
- 15,QUIT,
-
- 16,QUIT,
- FAILURE
- 17,QUIT,
- exits with a return code indicating failure.
- 18,QUIT,
-
- 19,QUIT,
- WARNING
- 20,QUIT,
- exits with a return code indicating warning. QUIT with no clauses
- 21,QUIT,
- exits with a value of SUCCESS.
- 22,QUIT,
-
- 23,QUIT,
- n is an integer you can specify as the return code.
- 24,QUIT,
-
- 25,QUIT,
- variable
- 26,QUIT,
- is a user-defined or system variable, like SQL.SQLCODE.
- 27,QUIT,
- QUIT variable exits with the value of variable as the return code.
- 28,QUIT,
-
- 29,QUIT,
- QUIT enables you to specify an operating system return code so you can run
- 30,QUIT,
- SQL*Plus command files in batch mode and detect an unexpected event. The
- 31,QUIT,
- manner of detection is operating-system specific. SUCCESS, WARNING, and
- 32,QUIT,
- FAILURE represent operating system dependent values; on some systems,
- 33,QUIT,
- WARNING and FAILURE are not distinguishable. To QUIT conditionally, use
- 34,QUIT,
- WHENEVER SQLERROR.
- 35,QUIT,
-
- 36,QUIT,
-
- 37,QUIT,
- Example: The following returns the error code of the last executed SQL
- 38,QUIT,
- command or PL/SQL block:
- 39,QUIT,
-
- 40,QUIT,
- SQL> QUIT SQL.SQLCODE
- 41,QUIT,
-
- 42,QUIT,
- The location of the return code depends on your system.
- 43,QUIT,
-
- 44,QUIT,
-
- 45,QUIT,
- See also: connect, disconnect, host, save, spool, SQLPlus,
- 46,QUIT,
- whenever sqlerror, commands, menu.
- 1,Query,
-
- 2,Query,
-
- 3,Query,
- Query
- 4,Query,
-
- 5,Query,
- A query is a SQL instruction to retrieve data from one or more tables
- 6,Query,
- or views. A subquery is a query within another statement.
- 7,Query,
-
- 8,Query,
- Use queries to:
- 9,Query,
-
- 10,Query,
- - Define the set of rows in the target table with COPY,
- 11,Query,
- INSERT, or CREATE TABLE.
- 12,Query,
-
- 13,Query,
- - Obtain values for comparison in WHERE, HAVING, and
- 14,Query,
- START WITH clauses within SELECT, UPDATE, and DELETE
- 15,Query,
- statements.
- 16,Query,
-
- 17,Query,
- SELECT...WHERE expr oper query
- 18,Query,
- ...HAVING expr oper query
- 19,Query,
- ...START WITH expr oper query
- 20,Query,
-
- 21,Query,
- UPDATE...SET(column, column,..) oper query
- 22,Query,
- ...WHERE expr oper query
- 23,Query,
-
- 24,Query,
- DELETE...WHERE expr oper query
- 25,Query,
-
- 26,Query,
- INSERT...query
- 27,Query,
-
- 28,Query,
-
- 29,Query,
- See also: example query, subquery, select, update, delete, where,
- 30,Query,
- create table, uses of select, commands, menu.
- 1,RAISE,
-
- 2,RAISE,
- RAISE
- 3,RAISE,
- PL/SQL statement
- 4,RAISE,
- RAISE(exception_name);
- 5,RAISE,
-
- 6,RAISE,
- RAISE;
- 7,RAISE,
-
- 8,RAISE,
-
- 9,RAISE,
- RAISE stops execution of the PL/SQL block and transfers control to
- 10,RAISE,
- the exception handler declared for exception_name.
- 11,RAISE,
-
- 12,RAISE,
- Use RAISE only within an exception handler to re-raise the current
- 13,RAISE,
- exception and look for its handler in the enclosing blocks.
- 14,RAISE,
-
- 15,RAISE,
- If PL/SQL finds no handler for exception_name in the current block,
- 16,RAISE,
- the exception is passed to the enclosing blocks until it's handler
- 17,RAISE,
- is found. If there is no matching exception handler, an unhandled
- 18,RAISE,
- exception error occurs, and execution stops.
- 19,RAISE,
-
- 20,RAISE,
-
- 21,RAISE,
- See also: declare, error handling, exception, blocks, commands, menu.
- 1,RAW,
-
- 2,RAW,
-
- 3,RAW,
- RAW
- 4,RAW,
-
- 5,RAW,
- RAW(size)
- 6,RAW,
-
- 7,RAW,
- Use the RAW datatype in SQL to store byte-oriented data: character
- 8,RAW,
- strings and graphics character sequences. ORACLE displays RAW data
- 9,RAW,
- as hexidecimal character values.
- 10,RAW,
-
- 11,RAW,
- The maximum RAW size is 255 bytes. RAW is like CHAR, except when
- 12,RAW,
- transmitted via SQL*Net, which converts ASCII representations to
- 13,RAW,
- EBCDIC, and EBCDIC representations to ASCII. The size parameter
- 14,RAW,
- is optional; if omitted, it defaults to 1.
- 15,RAW,
-
- 16,RAW,
-
- 17,RAW,
- See also: long, long raw, raw, char, date, number, boolean, connect,
- 18,RAW,
- menu.
- 1,REMARK,
-
- 2,REMARK,
-
- 3,REMARK,
- REMARK
- 4,REMARK,
-
- 5,REMARK,
- REM[ARK]
- 6,REMARK,
-
- 7,REMARK,
- REMARK at the beginning of a line signifies a comment in a command file.
- 8,REMARK,
- The comment ends at the end of the line. A line cannot contain both a
- 9,REMARK,
- comment and a command. See /* for information on entering comments in
- 10,REMARK,
- statements.
- 11,REMARK,
-
- 12,REMARK,
- Example: Here are some typical comments in command files:
- 13,REMARK,
-
- 14,REMARK,
- SQL> GET EMPSUM
- 15,REMARK,
-
- 16,REMARK,
- 1 REM Uses BREAK ON REPORT to break on end of table.
- 17,REMARK,
- 2 BREAK ON REPORT
- 18,REMARK,
- 3 COMPUTE SUM OF "DEPARTMENT 10" "DEPARTMENT 20" -
- 19,REMARK,
- 4 "DEPARTMENT 30" "TOTAL BY JOB" ON REPORT
- 20,REMARK,
- 5 REM Each column displays the sums of salaries by job
- 21,REMARK,
- 6 REM for one of the departments 10, 20, 30.
- 22,REMARK,
- 7 SELECT JOB,
- 23,REMARK,
- 8 SUM( DECODE( DEPTNO, 10, SAL, 0)) "DEPARTMENT 10",
- 24,REMARK,
- 9 SUM( DECODE( DEPTNO, 20, SAL, 0)) "DEPARTMENT 20",
- 25,REMARK,
- 10 SUM( DECODE( DEPTNO, 30, SAL, 0)) "DEPARTMENT 30",
- 26,REMARK,
- 11 SUM(SAL) "TOTAL BY JOB"
- 27,REMARK,
- 12 FROM EMP
- 28,REMARK,
- 13* GROUP BY JOB
- 29,REMARK,
-
- 30,REMARK,
-
- 31,REMARK,
- See also: /, @, comments, edit, get, start, run, whenever sqlerror,
- 32,REMARK,
- commands, menu.
- 1,RENAME,
-
- 2,RENAME,
- RENAME
- 3,RENAME,
- SQL statement
- 4,RENAME,
- RENAME old TO new
- 5,RENAME,
-
- 6,RENAME,
- RENAME changes the name of a table, view, or synonym from old to new.
- 7,RENAME,
- Grants and indexes belonging to the old object are transferred to the
- 8,RENAME,
- new one.
- 9,RENAME,
-
- 10,RENAME,
- Columns cannot be renamed with RENAME; use CREATE TABLE...AS SELECT
- 11,RENAME,
- instead. For example, rename column oldcol to newcol in table static
- 12,RENAME,
- (with one column) by entering:
- 13,RENAME,
-
- 14,RENAME,
- CREATE TABLE temporary (newcol) AS SELECT (oldcol) FROM static
- 15,RENAME,
- DROP TABLE static
- 16,RENAME,
- RENAME temporary TO static
- 17,RENAME,
-
- 18,RENAME,
-
- 19,RENAME,
- See also: create synonym, create table, create view, identifiers, tables,
- 20,RENAME,
- views, synonyms, commands, menu.
- 1,REVOKE,
-
- 2,REVOKE,
-
- 3,REVOKE,
- REVOKE
- 4,REVOKE,
- SQL statement
- 5,REVOKE,
- There are three ways to use REVOKE: 1) to remove database privileges
- 6,REVOKE,
- from one or more users; 2) to remove the ability of one or more users
- 7,REVOKE,
- to create objects in the specified tablespace (and prevents allocation
- 8,REVOKE,
- of more database space to those users' objects); and 3) to remove access
- 9,REVOKE,
- privileges for one or more users to tables, views, and sequences.
- 10,REVOKE,
-
- 11,REVOKE,
-
- 12,REVOKE,
- *First Method*
- 13,REVOKE,
-
- 14,REVOKE,
- REVOKE CONNECT, RESOURCE, DBA
- 15,REVOKE,
- FROM user, user,...
- 16,REVOKE,
-
- 17,REVOKE,
- This type of REVOKE removes database privileges from one or more users.
- 18,REVOKE,
- Before revoking CONNECT from a user, we recommend that all objects
- 19,REVOKE,
- owned by that user be dropped first. REVOKE requires DBA privileges.
- 20,REVOKE,
-
- 21,REVOKE,
- *Second Method*
- 22,REVOKE,
-
- 23,REVOKE,
- REVOKE RESOURCE ON tablespace
- 24,REVOKE,
- FROM user, user,...
- 25,REVOKE,
-
- 26,REVOKE,
- This type of REVOKE removes the ability of one or more users to create
- 27,REVOKE,
- objects in the specified tablespace, and prevents the allocation of
- 28,REVOKE,
- further database space to those users' objects.
- 29,REVOKE,
-
- 30,REVOKE,
- *Third Method*
- 31,REVOKE,
-
- 32,REVOKE,
- REVOKE object_privilege, object_privilege,... | ALL
- 33,REVOKE,
- ON user.object
- 34,REVOKE,
- FROM PUBLIC | user, user,...
- 35,REVOKE,
-
- 36,REVOKE,
- This type of REVOKE removes access privileges for one or more users to
- 37,REVOKE,
- tables, views, and sequences. You must own the object, or have been
- 38,REVOKE,
- granted WITH GRANT OPTION on the table.
- 39,REVOKE,
-
- 40,REVOKE,
- If a user is authorized to access a table by more than one person, he/she
- 41,REVOKE,
- may use the table until privileges are revoked by all who granted them.
- 42,REVOKE,
-
- 43,REVOKE,
- object_privilege
- 44,REVOKE,
- for tables: ALTER, DELETE, INDEX, INSERT, REFERENCES, SELECT,
- 45,REVOKE,
- or UPDATE
- 46,REVOKE,
-
- 47,REVOKE,
- for views: DELETE, INSERT, SELECT, or UPDATE
- 48,REVOKE,
-
- 49,REVOKE,
- for sequences: ALTER or SELECT
- 50,REVOKE,
-
- 51,REVOKE,
-
- 52,REVOKE,
- See also: audit, grant, dba, commands, menu.
- 1,ROLLBACK,
-
- 2,ROLLBACK,
-
- 3,ROLLBACK,
- ROLLBACK
- 4,ROLLBACK,
- SQL statement
- 5,ROLLBACK,
- ROLLBACK WORK;
- 6,ROLLBACK,
-
- 7,ROLLBACK,
- ROLLBACK TO SAVEPOINT savepoint_name;
- 8,ROLLBACK,
-
- 9,ROLLBACK,
- ROLLBACK discards all database changes made since the last COMMIT
- 10,ROLLBACK,
- statement, and erases all savepoints.
- 11,ROLLBACK,
-
- 12,ROLLBACK,
- ROLLBACK TO savepoint_name undoes all database changes made since
- 13,ROLLBACK,
- the last SAVEPOINT statement with that name.
- 14,ROLLBACK,
-
- 15,ROLLBACK,
- ORACLE creates an implicit savepoint before an INSERT, UPDATE, or
- 16,ROLLBACK,
- DELETE statement is executed, and automatically issues a ROLLBACK
- 17,ROLLBACK,
- to that point if the statement fails.
- 18,ROLLBACK,
-
- 19,ROLLBACK,
- WORK and SAVEPOINT are optional; use them to make reading easier.
- 20,ROLLBACK,
-
- 21,ROLLBACK,
-
- 22,ROLLBACK,
- See also: example rollback, commit, savepoint, insert, update,
- 23,ROLLBACK,
- delete, commands, menu.
- 1,RUN,
-
- 2,RUN,
-
- 3,RUN,
- RUN
- 4,RUN,
-
- 5,RUN,
- R[UN]
- 6,RUN,
-
- 7,RUN,
- RUN lists and executes the SQL command or PL/SQL block currently in the
- 8,RUN,
- SQL buffer. RUN makes the last line of the SQL buffer the current line.
- 9,RUN,
- The slash command (/) works like RUN, but doesn't list the command.
- 10,RUN,
-
- 11,RUN,
- Example: The SQL buffer contains the query:
- 12,RUN,
-
- 13,RUN,
- SELECT DEPTNO FROM DEPT
- 14,RUN,
-
- 15,RUN,
- To RUN the query, enter:
- 16,RUN,
-
- 17,RUN,
- SQL> RUN
- 18,RUN,
-
- 19,RUN,
- Output: 1* SELECT DEPTNO FROM DEPT
- 20,RUN,
-
- 21,RUN,
- DEPTNO
- 22,RUN,
- ------
- 23,RUN,
- 10
- 24,RUN,
- 20
- 25,RUN,
- 30
- 26,RUN,
- 40
- 27,RUN,
-
- 28,RUN,
-
- 29,RUN,
- See also: /, @, edit, get, list, parameters, save, spool, start,
- 30,RUN,
- SQL in PL/SQL, commands, menu.
- 1,RUNFORM,
-
- 2,RUNFORM,
-
- 3,RUNFORM,
- RUNFORM
- 4,RUNFORM,
-
- 5,RUNFORM,
- RUNFORM [options] form_name
- 6,RUNFORM,
-
- 7,RUNFORM,
- RUNFORM invokes a SQL*Forms application from within SQL*Plus. Note: You
- 8,RUNFORM,
- have access to this command only if your site chose this option while
- 9,RUNFORM,
- installing SQL*Plus.
- 10,RUNFORM,
-
- 11,RUNFORM,
- [options]
- 12,RUNFORM,
- See your SQL*Forms Designer's Reference Manual for details.
- 13,RUNFORM,
-
- 14,RUNFORM,
- form_name
- 15,RUNFORM,
- See your SQL*Forms Designer's Reference Manual for details.
- 16,RUNFORM,
-
- 17,RUNFORM,
- The RUNFORM syntax is the same in both SQL*Plus and SQL*Forms. You can
- 18,RUNFORM,
- invoke a form more quickly in SQL*Plus than you can from the system prompt
- 19,RUNFORM,
- because you avoid a separate ORACLE logon.
- 20,RUNFORM,
-
- 21,RUNFORM,
- When you invoke a form in SQL*Plus (by using RUNFORM), do not specify a
- 22,RUNFORM,
- username/password (you retain your current connection to ORACLE). To use
- 23,RUNFORM,
- another username/password, use the CONNECT command to connect to the
- 24,RUNFORM,
- username before issuing the RUNFORM command.
- 25,RUNFORM,
-
- 26,RUNFORM,
-
- 27,RUNFORM,
- Example: To run a form named MYFORM, enter:
- 28,RUNFORM,
-
- 29,RUNFORM,
- SQL> RUNFORM MYFORM
- 30,RUNFORM,
-
- 31,RUNFORM,
-
- 32,RUNFORM,
- See also: commands, menu.
- 1,Remote Databases,
-
- 2,Remote Databases,
-
- 3,Remote Databases,
- Remote Databases
- 4,Remote Databases,
-
- 5,Remote Databases,
- Many installations run ORACLE on more than one computer. Such computers
- 6,Remote Databases,
- are often connected in a network, so programs on different computers can
- 7,Remote Databases,
- exchange data. Networked computers can be physically near each other, or
- 8,Remote Databases,
- separated by large distances and connected by telecommunication links.
- 9,Remote Databases,
-
- 10,Remote Databases,
- Remote databases are databases on other computers and on the host computer
- 11,Remote Databases,
- other than your default database. You can access a remote database if it
- 12,Remote Databases,
- has SQL*Net and a network driver compatible with the local database. You
- 13,Remote Databases,
- can access a remote database inside SQL*Plus (with the CONNECT command),
- 14,Remote Databases,
- or as you start SQL*Plus (with the SQLPLUS command).
- 15,Remote Databases,
-
- 16,Remote Databases,
- Accessing a Remote Database from within SQL*Plus
- 17,Remote Databases,
-
- 18,Remote Databases,
- To access a remote database using CONNECT, include a SQL*Net database
- 19,Remote Databases,
- specification in the CONNECT command in one of these forms:
- 20,Remote Databases,
-
- 21,Remote Databases,
- CONNECT SCOTT@database_specification
- 22,Remote Databases,
- CONNECT SCOTT/TIGER@database_specification
- 23,Remote Databases,
-
- 24,Remote Databases,
- SQL*Plus connects you to the database, which is the default until you
- 25,Remote Databases,
- CONNECT to another one, DISCONNECT, or exit SQL*Plus. The database
- 26,Remote Databases,
- specification string depends upon your computer's SQL*Net protocol.
- 27,Remote Databases,
-
- 28,Remote Databases,
- Accessing a Remote Database as You Start SQL*Plus
- 29,Remote Databases,
-
- 30,Remote Databases,
- To connect to a remote database when you start SQL*Plus, include one
- 31,Remote Databases,
- of these SQL*Net database specification forms in your SQLPLUS command:
- 32,Remote Databases,
-
- 33,Remote Databases,
- SQLPLUS SCOTT@database_specification
- 34,Remote Databases,
- SQLPLUS SCOTT/TIGER@database_specification
- 35,Remote Databases,
-
- 36,Remote Databases,
- The username, password, and database_specification must be valid in
- 37,Remote Databases,
- the remote database. SQL*Plus starts and connects you to the remote
- 38,Remote Databases,
- database, which is the default database until you CONNECT to another
- 39,Remote Databases,
- database, DISCONNECT, or exit SQL*Plus.
- 40,Remote Databases,
-
- 41,Remote Databases,
- See also: commands, menu.
- 1,Reserved Words,
-
- 2,Reserved Words,
-
- 3,Reserved Words,
- Reserved Words
- 4,Reserved Words,
-
- 5,Reserved Words,
- The following words have special meaning in SQL and PL/SQL, and may
- 6,Reserved Words,
- not be used for identifier names (unless enclosed in "quotes"):
- 7,Reserved Words,
-
- 8,Reserved Words,
- ABORT AUDIT CLUSTERS DATA_BASE DISPOSE
- 9,Reserved Words,
- ACCEPT AUTHORIZATION COLAUTH DATE DISTINCT
- 10,Reserved Words,
- ACCESS AVG COLUMN DBA DO
- 11,Reserved Words,
- ADD BEGIN COMMENT DEBUGOFF DROP
- 12,Reserved Words,
- ALL BETWEEN COMMIT DEBUGON ELSE
- 13,Reserved Words,
- ALTER BODY COMPRESS DECIMAL ELSIF
- 14,Reserved Words,
- AND BOOLEAN CONNECT DECLARE END
- 15,Reserved Words,
- ANY BY CONSTANT DEFAULT ENTRY
- 16,Reserved Words,
- ARRAY CASE COUNT DEFINITION EXCEPTION
- 17,Reserved Words,
- AS CHAR CRASH DELAY EXCEPTION_INIT
- 18,Reserved Words,
- ASC CHAR_BASE CREATE DELETE EXCLUSIVE
- 19,Reserved Words,
- ASSERT CHECK CURRENT DELTA EXISTS
- 20,Reserved Words,
- ASSIGN CLOSE CURSOR DESC EXIT
- 21,Reserved Words,
- AT CLUSTER DATABASE DIGITS FALSE
- 22,Reserved Words,
-
- 23,Reserved Words,
-
- 24,Reserved Words,
-
- 25,Reserved Words,
- FETCH IF LIKE NOCOMPRESS OTHERS
- 26,Reserved Words,
- FILE IMMEDIATE LIMITED NOT OUT
- 27,Reserved Words,
- FLOAT IN LOCK NOWAIT PACKAGE
- 28,Reserved Words,
- FOR INCREMENT LONG NULL PARTITION
- 29,Reserved Words,
- FORM INDEX LOOP NUMBER PCTFREE
- 30,Reserved Words,
- FROM INDEXES MAX NUMBER_BASE PRAGMA
- 31,Reserved Words,
- FUNCTION INDICATOR MAXEXTENTS OF PRIOR
- 32,Reserved Words,
- GENERIC INITIAL MIN OFFLINE PRIVATE
- 33,Reserved Words,
- GOTO INSERT MINUS ON PRIVILEGES
- 34,Reserved Words,
- GRANT INTEGER MOD ONLINE PROCEDURE
- 35,Reserved Words,
- GRAPHIC INTERSECT MODE OPEN PUBLIC
- 36,Reserved Words,
- GROUP INTO MODIFY OPTION RAISE
- 37,Reserved Words,
- HAVING IS NEW OR RANGE
- 38,Reserved Words,
- IDENTIFIED LEVEL NOAUDIT ORDER RAW
- 39,Reserved Words,
-
- 40,Reserved Words,
-
- 41,Reserved Words,
-
- 42,Reserved Words,
- RECORD ROWTYPE SQLERRM THEN VARGRAPH
- 43,Reserved Words,
- RELEASE RUN START TO VARIANCE
- 44,Reserved Words,
- REM SAVEPOINT STATEMENT TRIGGER VIEW
- 45,Reserved Words,
- REMARK SCHEMA STDDEV TRUE VIEWS
- 46,Reserved Words,
- RENAME SELECT SUBTYPE TYPE WHEN
- 47,Reserved Words,
- RESOURCE SEPARATE SUCCESSFUL UID WHENEVER
- 48,Reserved Words,
- RETURN SESSION SUM UNION WHERE
- 49,Reserved Words,
- REVERSE SET SYNONYM UNIQUE WHILE
- 50,Reserved Words,
- REVOKE SHARE SYSDATE UPDATE WITH
- 51,Reserved Words,
- ROLLBACK SIZE TABAUTH USE WORK
- 52,Reserved Words,
- ROW SMALLINT TABLE USER XOR
- 53,Reserved Words,
- ROWID SPACE TABLES VALIDATE
- 54,Reserved Words,
- ROWNUM SQL TASK VALUES
- 55,Reserved Words,
- ROWS SQLCODE TERMINATE VARCHAR
- 56,Reserved Words,
-
- 57,Reserved Words,
-
- 58,Reserved Words,
-
- 59,Reserved Words,
- See also: identifiers, commands, menu.
- 1,SAVE,
-
- 2,SAVE,
-
- 3,SAVE,
- SAVE
- 4,SAVE,
-
- 5,SAVE,
- SAV[E] file_name[.ext] [CRE[ATE]|REP[LACE]|APP[END]]
- 6,SAVE,
-
- 7,SAVE,
- SAVE stores the buffer's contents in a host operating system command file.
- 8,SAVE,
- When you SAVE the contents of the SQL buffer, SAVE adds a line containing
- 9,SAVE,
- a slash (/) to the end of the file.
- 10,SAVE,
-
- 11,SAVE,
- file_name[.ext ]
- 12,SAVE,
- specifies the command file in which to save the buffer's
- 13,SAVE,
- contents. If you don't specify an extension, SQL*Plus assumes the
- 14,SAVE,
- default extension (normally SQL). For information on changing the
- 15,SAVE,
- default extension, see the SUFFIX variable of the SET command.
- 16,SAVE,
-
- 17,SAVE,
- To SAVE a file under a name identical to a SAVE command clause
- 18,SAVE,
- (CREATE, REPLACE, or APPEND), you must specify a file extension.
- 19,SAVE,
-
- 20,SAVE,
- CRE[ATE]
- 21,SAVE,
- creates the file if the file does not exist.
- 22,SAVE,
-
- 23,SAVE,
- REP[LACE]
- 24,SAVE,
- replaces the contents of an existing file. If the file does not
- 25,SAVE,
- exist, REPLACE creates the file.
- 26,SAVE,
-
- 27,SAVE,
- APP[END]
- 28,SAVE,
- adds the contents of the buffer to the end of the specified file.
- 29,SAVE,
-
- 30,SAVE,
-
- 31,SAVE,
- Example: To save the buffer's contents in file DEPTSALRPT.SQL, enter:
- 32,SAVE,
-
- 33,SAVE,
- SQL> SAVE DEPTSALRPT
- 34,SAVE,
-
- 35,SAVE,
-
- 36,SAVE,
- To save the buffer's contents in file DEPTSALRPT.OLD, enter:
- 37,SAVE,
-
- 38,SAVE,
- SQL> SAVE DEPTSALRPT.OLD
- 39,SAVE,
-
- 40,SAVE,
- See also: commands, menu.
- 1,SAVEPOINT,
-
- 2,SAVEPOINT,
-
- 3,SAVEPOINT,
- SAVEPOINT
- 4,SAVEPOINT,
- SQL statement
- 5,SAVEPOINT,
- SAVEPOINT savepoint_name;
- 6,SAVEPOINT,
-
- 7,SAVEPOINT,
- SAVEPOINT names the current point in a transaction, so you can
- 8,SAVEPOINT,
- use a ROLLBACK statement with that same savepoint_name to undo
- 9,SAVEPOINT,
- any changes made since the SAVEPOINT.
- 10,SAVEPOINT,
-
- 11,SAVEPOINT,
- - If you reuse a savepoint_name within a transaction, the old
- 12,SAVEPOINT,
- SAVEPOINT with that name is erased.
- 13,SAVEPOINT,
-
- 14,SAVEPOINT,
- - ROLLBACK TO savepoint_name discards transactions made after
- 15,SAVEPOINT,
- the savepoint_name specified.
- 16,SAVEPOINT,
-
- 17,SAVEPOINT,
- - COMMIT and ROLLBACK without parameter erase all savepoints.
- 18,SAVEPOINT,
-
- 19,SAVEPOINT,
-
- 20,SAVEPOINT,
- See also: example rollback, transactions, rollback, commit, commands,
- 21,SAVEPOINT,
- menu.
- 1,SELECT,
-
- 2,SELECT,
-
- 3,SELECT,
- SELECT
- 4,SELECT,
- SQL statement
- 5,SELECT,
- SELECT ALL | DISTINCT * | table.* | expr alias,...
- 6,SELECT,
- FROM user.table, table alias,...
- 7,SELECT,
- WHERE condition
- 8,SELECT,
- CONNECT BY condition START WITH condition
- 9,SELECT,
- GROUP BY expr, expr... HAVING condition
- 10,SELECT,
- UNION | INTERSECT | MINUS SELECT...
- 11,SELECT,
- ORDER BY expr | ASC | DESC,...
- 12,SELECT,
- FOR UPDATE OF column, column... NOWAIT;
- 13,SELECT,
-
- 14,SELECT,
- SELECT retrieves rows and columns from one or more tables. By itself,
- 15,SELECT,
- a select statement is a query; it is a subquery when it is a clause
- 16,SELECT,
- in another statement. FROM is required; all other clauses are optional.
- 17,SELECT,
- clauses must be in the order shown above when used together.
- 18,SELECT,
-
- 19,SELECT,
- For more information, type help, a space, and all or part of a topic.
- 20,SELECT,
-
- 21,SELECT,
- See also: bnf syntax, uses of select, query, subquery, from, where,
- 22,SELECT,
- aliases, connect by, group by, order by, for update of,
- 23,SELECT,
- set operators, other operators, expressions, conditions,
- 24,SELECT,
- example query, example subquery, commands, menu.
- 1,SELECT INTO,
-
- 2,SELECT INTO,
- SELECT INTO
- 3,SELECT INTO,
- PL/SQL statement
- 4,SELECT INTO,
- SELECT_list INTO variable_list
- 5,SELECT INTO,
- FROM table, table,...
- 6,SELECT INTO,
- rest_of_statement;
- 7,SELECT INTO,
-
- 8,SELECT INTO,
-
- 9,SELECT INTO,
- For each item in the SELECT_list, SELECT...INTO retrieves a value
- 10,SELECT INTO,
- FROM the specified table(s), and puts the value INTO its parallel
- 11,SELECT INTO,
- item in the variable_list. The datatypes of corresponding items
- 12,SELECT INTO,
- in the tables, SELECT_list, and variable_list must be compatible
- 13,SELECT INTO,
- or convertible.
- 14,SELECT INTO,
-
- 15,SELECT INTO,
- Store retrieved data in a record variable by declaring the record
- 16,SELECT INTO,
- variable first with the %ROWTYPE attribute.
- 17,SELECT INTO,
-
- 18,SELECT INTO,
-
- 19,SELECT INTO,
- See also: example select into, select list, variables, select,
- 20,SELECT INTO,
- implicit conversions, attributes, fetch, commands, menu.
- 1,SELECT List,
-
- 2,SELECT List,
-
- 3,SELECT List,
- SELECT List
- 4,SELECT List,
-
- 5,SELECT List,
- SELECT list
- 6,SELECT List,
- FROM...
- 7,SELECT List,
-
- 8,SELECT List,
- The SELECT list is one or more items of information, separated by
- 9,SELECT List,
- commas, between the word SELECT and the FROM clause. The order of
- 10,SELECT List,
- SELECT list entries determines the order of columns in the result.
- 11,SELECT List,
- The SELECT list may contain:
- 12,SELECT List,
-
- 13,SELECT List,
- - Column names and their aliases: ename employee, deptno
- 14,SELECT List,
- - Expressions in columns and constraints or host variables
- 15,SELECT List,
- - Group functions: MAX(sal), MIN(comm)
- 16,SELECT List,
- - Non-group functions: SYSDATE, INITCAP(ename)
- 17,SELECT List,
-
- 18,SELECT List,
- If the GROUP BY clause is used, the SELECT list may contain only
- 19,SELECT List,
- group functions, expressions also listed in the GROUP BY clause,
- 20,SELECT List,
- and constants or functions without parameters (such as SYSDATE).
- 21,SELECT List,
-
- 22,SELECT List,
-
- 23,SELECT List,
- See also: example select list, select, group by, alias, expressions,
- 24,SELECT List,
- group functions, uses of select, menu.
- 1,SET,
-
- 2,SET,
-
- 3,SET,
- SET
- 4,SET,
-
- 5,SET,
- SET system_variable value
- 6,SET,
- NUMF[ORMAT] format
- 7,SET,
- ARRAY[SIZE] {20|n} NUM[WIDTH] {10|n}
- 8,SET,
- AUTO[COMMIT] {OFF|ON|IMM[EDIATE]} PAGES[IZE] {14|n}
- 9,SET,
- BLO[CKTERMINATOR] {.|c} PAU[SE] {OFF|ON|text}
- 10,SET,
- CMDS[EP] {;|c|OFF|ON} RECSEP {WR[APPED]|EA[CH]|OFF}
- 11,SET,
- COM[PATIBILITY] {V5|V6} RECSEPCHAR {_|c}SCAN {OFF|ON}
- 12,SET,
- CON[CAT] {.|c|OFF|ON} SHOW[MODE] {OFF|ON}
- 13,SET,
- COPYC[OMMIT] {0|n} SPA[CE] {1|n}
- 14,SET,
- CRT crt SQLC[ASE] {MIX[ED]|LO[WER]|UP[PER]}
- 15,SET,
- DEF[INE] {&|c|OFF|ON} SQLCO[NTINUE] {> | text}
- 16,SET,
- ECHO {OFF|ON} SQLN[UMBER] {OFF|ON}
- 17,SET,
- EMBEDDED {OFF|ON} SQLPRE[FIX] {#|c}
- 18,SET,
- ESC[APE] {\|c|OFF|ON} SQLP[ROMPT] {SQL>|text}
- 19,SET,
- FEED[BACK] {6|n|OFF|ON} SQLT[ERMINATOR] {;|c|OFF|ON}
- 20,SET,
- FLU[SH] {OFF|ON} SUF[FIX] {SQL|text}
- 21,SET,
- HEA[DING] {OFF|ON} TAB {OFF|ON}TERM[OUT] {OFF|ON}
- 22,SET,
- HEADS[EP] {||c|OFF|ON} TI[ME] {OFF|ON}
- 23,SET,
- LIN[ESIZE] {80|n} TIMI[NG] {OFF|ON}
- 24,SET,
- LONG {80|n} TRIM[OUT] {OFF|ON}
- 25,SET,
- MAXD[ATA] n UND[ERLINE] {-|c|ON|OFF}
- 26,SET,
- NEWP[AGE] {1|n} VER[IFY] {OFF|ON}
- 27,SET,
- NULL text WRA[P] {OFF|ON}
- 28,SET,
-
- 29,SET,
-
- 30,SET,
- Use SET to control SQL*Plus environment settings for the current session;
- 31,SET,
- for example: - the display width for NUMBER data
- 32,SET,
- - the display width for LONG data
- 33,SET,
- - enabling or disabling the printing of column headings
- 34,SET,
- - the number of lines per page
- 35,SET,
-
- 36,SET,
- ARRAY[SIZE] {20|n}
- 37,SET,
- sets the number of rowscalled a batchthat SQL*Plus will fetch from
- 38,SET,
- the database at one time (Range:1 - 5000). A large value increases
- 39,SET,
- the efficiency of queries and subqueries that fetch many rows, but
- 40,SET,
- requires more main memory in the host computer; values over 100 or
- 41,SET,
- so provide little added performance. ARRAYSIZE only improves the
- 42,SET,
- efficiency of SQL*Plus operations; it has no other effect.
- 43,SET,
-
- 44,SET,
- AUTO[COMMIT] {OFF|ON|IMM[EDIATE]}
- 45,SET,
- controls when ORACLE commits pending changes to the database. ON
- 46,SET,
- commits pending changes to the database after ORACLE executes each
- 47,SET,
- SQL command or PL/SQL block. OFF suppresses automatic committing,
- 48,SET,
- so changes must be committed manually (with COMMIT, for example).
- 49,SET,
- IMMEDIATE works just like ON.
- 50,SET,
-
- 51,SET,
- BLO[CKTERMINATOR] {.|c}
- 52,SET,
- sets the non-alphanumeric character that ends PL/SQL blocks to c.
- 53,SET,
- To execute the block, issue a RUN or / (slash) command.
- 54,SET,
-
- 55,SET,
- CMDS[EP] {;|c|ON|OFF}
- 56,SET,
- sets the non-alphanumeric character used between multiple SQL*Plus
- 57,SET,
- commands entered on one line to c. ON or OFF sets whether or not
- 58,SET,
- multiple commands can be entered on a line; ON automatically makes
- 59,SET,
- ; (a semicolon) the command separator character.
- 60,SET,
-
- 61,SET,
- COM[PATIBILITY] {V5|V6}
- 62,SET,
- controls whether SQL*Plus stores COMMIT and ROLLBACK commands in
- 63,SET,
- the SQL buffer. V6 stores them; V5 does not. Set COMPATIBILITY
- 64,SET,
- V5 to run command files created in ORACLE Version 5, V6 to run
- 65,SET,
- command files created with Version 6. See COMMIT and ROLLBACK.
- 66,SET,
-
- 67,SET,
- CON[CAT] {.|c|OFF|ON}
- 68,SET,
- sets the character you can use to end a substitution variable name
- 69,SET,
- when you want to use a character after the variable that SQL*Plus
- 70,SET,
- would otherwise see as a part of the variable's name. SQL*Plus
- 71,SET,
- resets the value of CONCAT to a period when you switch CONCAT on.
- 72,SET,
-
- 73,SET,
- COPYC[OMMIT] {0|n}
- 74,SET,
- controls the number of batches processed before the COPY command
- 75,SET,
- commits database changes (Range: 0 - 5000). Set the size of a
- 76,SET,
- batch with the ARRAYSIZE variable. If you set COPYCOMMIT to 0,
- 77,SET,
- COPY commits changes only at the end of a copy operation.
- 78,SET,
-
- 79,SET,
- CRT crt
- 80,SET,
- changes the default CRT file used in the SQL*Plus RUNFORM command.
- 81,SET,
- To return to the original default (before CRT was set), set CRT to
- 82,SET,
- nothing by entering two double quotes ("") for crt.
- 83,SET,
-
- 84,SET,
- To use NEW.CRT during a form invocation on a system where the
- 85,SET,
- default CRT is OLD.CRT, invoke the form with either:
- 86,SET,
-
- 87,SET,
- SQL> RUNFORM -c NEW form_name
- 88,SET,
- or SQL> SET CRT NEWSQL> RUNFORM form_name
- 89,SET,
-
- 90,SET,
- The second method stores the CRT option; you do not have to
- 91,SET,
- re-specify it for additional RUNFORM commands during the same
- 92,SET,
- SQL*Plus session.
- 93,SET,
-
- 94,SET,
- DEF[INE] {&|c|OFF|ON}
- 95,SET,
- sets c to be the character in front of substitution variables.
- 96,SET,
- ON or OFF sets whether or not SQL*Plus will scan commands for
- 97,SET,
- substitution variables and replace them with their values. An ON
- 98,SET,
- or OFF DEFINE setting overrides the setting of the SCAN variable.
- 99,SET,
-
- 100,SET,
- ECHO {OFF|ON}
- 101,SET,
- sets whether START lists each command in a command file as the
- 102,SET,
- command is executed. ON lists the commands; OFF does not.
- 103,SET,
-
- 104,SET,
- EMBEDDED {OFF|ON}
- 105,SET,
- controls each report begins on a page. OFF starts each report at
- 106,SET,
- the top of a new page; ON allows a report to begin anywhere. Set
- 107,SET,
- EMBEDDED to ON to start printing a report immediately after the
- 108,SET,
- previous one.
- 109,SET,
-
- 110,SET,
- ESC[APE] {\|c|OFF|ON}
- 111,SET,
- defines the character you enter as the escape character. OFF
- 112,SET,
- undefines the escape character. ON enables the escape character.
- 113,SET,
-
- 114,SET,
- Use the escape character before the substitution character (set
- 115,SET,
- with SET DEFINE) to have SQL*Plus treat the substitution character
- 116,SET,
- as an ordinary character, not a request for variable substitution.
- 117,SET,
-
- 118,SET,
- FEED[BACK] {6|n|OFF|ON}
- 119,SET,
- shows the number of records returned by a query when at n or more
- 120,SET,
- records are selected. ON sets n to 1. 0 is the same as OFF.
- 121,SET,
-
- 122,SET,
- FLU[SH] {OFF|ON}
- 123,SET,
- controls when output goes to the display device. OFF allows the
- 124,SET,
- host operating system to buffer output. ON disables buffering.
- 125,SET,
-
- 126,SET,
- Use FLUSH OFF only when running a command file non-interactively
- 127,SET,
- to suppress output and prompts until the run is over. FLUSH OFF
- 128,SET,
- may improve performance by reducing the amount of program I/O.
- 129,SET,
-
- 130,SET,
- HEA[DING] {OFF|ON}
- 131,SET,
- controls printing of column headings in reports. ON prints column
- 132,SET,
- headings in reports; OFF suppresses column headings.
- 133,SET,
-
- 134,SET,
- HEADS[EP] {||c|OFF|ON}
- 135,SET,
- sets the character you enter as the heading separator character.
- 136,SET,
- You can use the heading separator character in the COLUMN command
- 137,SET,
- and in the old forms of BTITLE and TTITLE to divide a column
- 138,SET,
- heading or title onto more than one line. Set HEADSEP OFF to
- 139,SET,
- print a heading separator character like any other character.
- 140,SET,
-
- 141,SET,
- LIN[ESIZE] {80|n}
- 142,SET,
- sets the total number of characters displayed on a line before
- 143,SET,
- starting a new line, and controls the position of centered and
- 144,SET,
- right-aligned text in TTITLE and BTITLE. The range is 1 - 500.
- 145,SET,
-
- 146,SET,
- LONG {80|n}
- 147,SET,
- sets the maximum width for displaying and copying LONG values; the
- 148,SET,
- range is 1 - 32767. LONG must be less than MAXDATA.
- 149,SET,
-
- 150,SET,
- MAXD[ATA] n
- 151,SET,
- sets the maximum size, in bytes, of all ARRAYSIZE rows. The
- 152,SET,
- default and maximum values of n depend on the operating system.
- 153,SET,
-
- 154,SET,
- NEWP[AGE] {1|n}
- 155,SET,
- sets the number of blank lines printed between the beginning of
- 156,SET,
- each page and the top title. A value of 0 sends a formfeed
- 157,SET,
- between pages and clears the screen on most terminals.
- 158,SET,
-
- 159,SET,
- NULL text
- 160,SET,
- sets the text to represent a null value in the result of a SELECT
- 161,SET,
- statement. NULL without text shows a blank (the default). Use the
- 162,SET,
- NULL clause of the COLUMN command to override the setting of the
- 163,SET,
- NULL variable for a given column.
- 164,SET,
-
- 165,SET,
- NUMF[ORMAT] format
- 166,SET,
- sets the default format for displaying numbers. Enter a number
- 167,SET,
- format for format. See FORMAT NUMBERS for format descriptions.
- 168,SET,
-
- 169,SET,
- NUM[WIDTH] {10|n}
- 170,SET,
- sets the default width for displaying numbers.
- 171,SET,
-
- 172,SET,
- PAGES[IZE] {14|n}
- 173,SET,
- sets the number of lines from the top title to the end of the
- 174,SET,
- page. With 11 inch long paper, a value of 54 (plus a NEWPAGE
- 175,SET,
- value of 6) leaves one-inch margins above and below a report.
- 176,SET,
-
- 177,SET,
- Set PAGESIZE to 0 to suppress headings, page breaks, titles, the
- 178,SET,
- initial blank line, and other formatting information.
- 179,SET,
-
- 180,SET,
- PAU[SE] {OFF|ON|text}
- 181,SET,
- controls scrolling on the terminal when running reports. Press
- 182,SET,
- RETURN or [Clear] after seeing each pause. ON pauses at the
- 183,SET,
- beginning of each page of report output. Text specifies the text
- 184,SET,
- displayed whenever SQL*Plus pauses. To enter multiple words,
- 185,SET,
- enclose text in 'single quotes'.
- 186,SET,
-
- 187,SET,
- You can embed terminal-dependent escape sequences in PAUSE to
- 188,SET,
- create inverse video messages and other effects, where supported.
- 189,SET,
-
- 190,SET,
- RECSEP {WR[APPED]|EA[CH]|OFF} and RECSEPCHAR { |c}
- 191,SET,
- displays or prints record separators. A record separator is the
- 192,SET,
- RECSEPCHAR (character) repeated LINESIZE times on a single line.
- 193,SET,
- (RECSEPCHAR is the record-separating character. Default = space.)
- 194,SET,
-
- 195,SET,
- RECSEP sets where the record separation occurs. WRAPPED prints a
- 196,SET,
- record separator only after wrapped lines. EACH prints a record
- 197,SET,
- separator after every row. OFF does not print a record separator.
- 198,SET,
-
- 199,SET,
- SCAN {OFF|ON}
- 200,SET,
- controls scanning for substitution variables and parameters.
- 201,SET,
- OFF suppresses their processing; ON allows normal processing.
- 202,SET,
-
- 203,SET,
- SHOW[MODE] {OFF|ON}
- 204,SET,
- controls whether or not SQL*Plus lists the old and new settings of
- 205,SET,
- a SQL*Plus system variable when you change the setting with SET.
- 206,SET,
- ON lists the settings; OFF does not. BOTH works like ON.
- 207,SET,
-
- 208,SET,
- SPA[CE] {1|n}
- 209,SET,
- sets the number of spaces between output columns (Maximum = 10).
- 210,SET,
-
- 211,SET,
- SQLC[ASE] {MIX[ED]|LO[WER]|UP[PER]}
- 212,SET,
- changes the case of SQL commands and PL/SQL blocks just prior to
- 213,SET,
- execution. SQL*Plus converts all text in the command, including
- 214,SET,
- quoted literals and identifiers, as follows:
- 215,SET,
-
- 216,SET,
- uppercase if SQLCASE equals UPPER
- 217,SET,
- lowercase if SQLCASE equals LOWER
- 218,SET,
- unchanged if SQLCASE equals MIXED
- 219,SET,
-
- 220,SET,
- SQLCASE does not change the SQL buffer itself.
- 221,SET,
-
- 222,SET,
- SQLCO[NTINUE] {>|text}
- 223,SET,
- sets the character sequence SQL*Plus displays as a prompt after
- 224,SET,
- you use - (hyphen) to continue a SQL*Plus command on a new line.
- 225,SET,
-
- 226,SET,
- SQLN[UMBER] {OFF|ON}
- 227,SET,
- sets the prompt for the second and subsequent lines of a SQL
- 228,SET,
- command or PL/SQL block. ON sets the prompt to be the line
- 229,SET,
- number. OFF sets the prompt to the value of SQLPROMPT.
- 230,SET,
-
- 231,SET,
- SQLPRE[FIX] {#|c}
- 232,SET,
- sets the SQL*Plus prefix character. While entering a SQL command
- 233,SET,
- or PL/SQL block, you can enter a SQL*Plus command on a separate
- 234,SET,
- line, prefixed by the SQL*Plus prefix character, to execute the
- 235,SET,
- command immediately without affecting the SQL command or PL/SQL
- 236,SET,
- block. The prefix character must be non-alphanumeric.
- 237,SET,
-
- 238,SET,
- SQLP[ROMPT] {SQL>|text}
- 239,SET,
- sets the SQL*Plus command prompt.
- 240,SET,
-
- 241,SET,
- SQLT[ERMINATOR] {;|c|OFF|ON}
- 242,SET,
- sets to c the character used to end and execute SQL command. OFF
- 243,SET,
- recognizes no command terminator; you terminate a SQL command by
- 244,SET,
- entering an empty line. ON resets the terminator to ; (semicolon).
- 245,SET,
-
- 246,SET,
- SUF[FIX] {SQL|text}
- 247,SET,
- sets the default file suffix (extension) that SQL*Plus uses in
- 248,SET,
- commands that refer to command files. SUFFIX does not control
- 249,SET,
- extensions for output (spool) files.
- 250,SET,
-
- 251,SET,
- TAB {OFF|ON}
- 252,SET,
- controls how SQL*Plus formats white space in the output. OFF uses
- 253,SET,
- spaces to add white space in the output. ON uses TAB characters.
- 254,SET,
- The default value is system-dependent; SHOW TAB shows the default.
- 255,SET,
-
- 256,SET,
- TERM[OUT] {OFF|ON}
- 257,SET,
- controls the display of output generated by commands executed from
- 258,SET,
- a file. OFF suppresses the display so you can spool output from a
- 259,SET,
- command file without displaying the output. ON shows the output.
- 260,SET,
- TERMOUT OFF doesn't affect interactively-entered command output.
- 261,SET,
-
- 262,SET,
- TI[ME] {OFF|ON}
- 263,SET,
- controls the display of the current time. ON displays the current
- 264,SET,
- time before each command prompt. OFF suppresses the time display.
- 265,SET,
-
- 266,SET,
- TIMI[NG] {OFF|ON}
- 267,SET,
- sets the display of timing statistics. ON shows timing statistics
- 268,SET,
- for each SQL command or PL/SQL block run. OFF suppresses timing.
- 269,SET,
- Use the TIMING command to control the timing of multiple commands.
- 270,SET,
-
- 271,SET,
- TRIM[OUT] {OFF|ON}
- 272,SET,
- determines whether SQL*Plus allows trailing blanks at the end of
- 273,SET,
- each displayed line. ON removes blanks at the end of each line,
- 274,SET,
- improving performance especially when using a slow communications
- 275,SET,
- device. OFF displays trailing blanks. TRIMOUT ON does not affect
- 276,SET,
- spooled output; SQL*Plus ignores TRIMOUT ON unless you set TAB ON.
- 277,SET,
-
- 278,SET,
- UND[ERLINE] {-|c|ON|OFF}
- 279,SET,
- sets the character used to underline column headings in SQL*Plus
- 280,SET,
- reports to c. ON or OFF turns underlining on or off without
- 281,SET,
- affecting the value of c.
- 282,SET,
-
- 283,SET,
- VER[IFY] {OFF|ON}
- 284,SET,
- controls whether SQL*Plus lists the text of a command before and
- 285,SET,
- after SQL*Plus replaces substitution variables with values. ON
- 286,SET,
- lists the text; OFF suppresses the listing.
- 287,SET,
-
- 288,SET,
- WRA[P] {OFF|ON}
- 289,SET,
- controls whether SQL*Plus truncates the display of a data item if
- 290,SET,
- it is longer than the current line width. OFF truncates it; ON
- 291,SET,
- allows it to wrap to the next line. The COLUMN command's WRAPPED
- 292,SET,
- and TRUNCATED override the WRAP setting for specific columns.
- 293,SET,
-
- 294,SET,
-
- 295,SET,
- SQL*Plus maintains system variables (SET command variables) so you can
- 296,SET,
- tailor the environment for a SQL*Plus session. You change these system
- 297,SET,
- variables with the SET command and list them with the SHOW command.
- 298,SET,
-
- 299,SET,
- Examples: Here are some uses of SET command variables:
- 300,SET,
-
- 301,SET,
- COMPATIBILITY - To run command file SALARY.SQL, created with
- 302,SET,
- Version 5 of ORACLE, enter:
- 303,SET,
-
- 304,SET,
- SQL> SET COMPATIBILITY V5SQL> START SALARY
- 305,SET,
-
- 306,SET,
- After running the file, reset compatibility to V6:
- 307,SET,
-
- 308,SET,
- SQL> SET COMPATIBILITY V6
- 309,SET,
-
- 310,SET,
- Or you could add SET COMPATIBILITY V5 to the beginning of the
- 311,SET,
- command file, and reset COMPATIBILITY to V6 at its end.
- 312,SET,
-
- 313,SET,
- ESCAPE - If you define the escape character as !, entering
- 314,SET,
-
- 315,SET,
- SQL> ACCEPT v1 PROMPT 'Enter !&1:'
- 316,SET,
-
- 317,SET,
- displays the prompt, Enter &1:
- 318,SET,
-
- 319,SET,
- HEADING - The next example suppresses the display of column
- 320,SET,
- headings in a report, then runs a SELECT statement:
- 321,SET,
-
- 322,SET,
- SQL> SET HEADING OFF
- 323,SET,
- SQL> SELECT ENAME, SAL FROM EMP 2 WHERE JOB = 'CLERK';
- 324,SET,
-
- 325,SET,
- Output: ADAMS 1100
- 326,SET,
- JAMES 950
- 327,SET,
- MILLER 1300
- 328,SET,
-
- 329,SET,
- LONG - To set the maximum width for displaying and copying LONG
- 330,SET,
- values to 500, enter:
- 331,SET,
-
- 332,SET,
- SQL> SET LONG 500
- 333,SET,
-
- 334,SET,
-
- 335,SET,
- The LONG data will wrap on your screen; SQL*Plus truncates at
- 336,SET,
- the 501st character.
- 337,SET,
-
- 338,SET,
- SQLCONTINUE - To set the SQL*Plus command continuation prompt to
- 339,SET,
- an exclamation point followed by a space, enter:
- 340,SET,
-
- 341,SET,
- SQL> SET SQLCONTINUE '! '
- 342,SET,
-
- 343,SET,
- SQL*Plus prompts for continuation as follows:
- 344,SET,
-
- 345,SET,
- SQL> TTITLE 'YEARLY INCOME' -
- 346,SET,
- ! RIGHT SQL.PNO SKIP 2 -
- 347,SET,
- ! CENTER 'PC DIVISION'
- 348,SET,
- SQL>
- 349,SET,
-
- 350,SET,
- SUFFIX - To set the default command file extension to UFI:
- 351,SET,
-
- 352,SET,
- SQL> SET SUFFIX UFI
- 353,SET,
-
- 354,SET,
- If you then enter:
- 355,SET,
-
- 356,SET,
- SQL> GET EXAMPLE
- 357,SET,
-
- 358,SET,
- SQL*Plus looks for file EXAMPLE.UFI instead of file EXAMPLE.SQL.
- 359,SET,
-
- 360,SET,
- See also: commands, menu.
- 1,SET TRANSACTION,
-
- 2,SET TRANSACTION,
-
- 3,SET TRANSACTION,
- SET TRANSACTION
- 4,SET TRANSACTION,
- SQL statement
- 5,SET TRANSACTION,
- SET TRANSACTION READ ONLY
- 6,SET TRANSACTION,
-
- 7,SET TRANSACTION,
-
- 8,SET TRANSACTION,
- SET TRANSACTION READ ONLY affects the current transaction. All
- 9,SET TRANSACTION,
- queries in the transaction ignore changes by other users since
- 10,SET TRANSACTION,
- the transaction began. SET TRANSACTION READ ONLY is especially
- 11,SET TRANSACTION,
- useful for generating reports which query multiple tables that
- 12,SET TRANSACTION,
- are constantly being updated by others. A COMMIT or a ROLLBACK
- 13,SET TRANSACTION,
- statement ends the read only state.
- 14,SET TRANSACTION,
-
- 15,SET TRANSACTION,
- You cannot use a DELETE, INSERT, or UPDATE statement in a READ
- 16,SET TRANSACTION,
- ONLY transaction; only queries are permitted. Actions of other
- 17,SET TRANSACTION,
- users and other transactions are not affected. SET TRANSACTION
- 18,SET TRANSACTION,
- READ ONLY must be the first statement in the transaction.
- 19,SET TRANSACTION,
-
- 20,SET TRANSACTION,
-
- 21,SET TRANSACTION,
- See also: example set transaction, transactions, query, commit,
- 22,SET TRANSACTION,
- rollback, commands, menu.
- 1,SHOW,
-
- 2,SHOW,
-
- 3,SHOW,
- SHOW
- 4,SHOW,
-
- 5,SHOW,
- SHO[W] option
- 6,SHOW,
-
- 7,SHOW,
- where option can be: system_variable, ALL, BTI[TLE], LNO, PNO,
- 8,SHOW,
- REL[EASE], SPOO[L], SQLCODE, TTI[TLE], USER.
- 9,SHOW,
-
- 10,SHOW,
- Use SHOW to display the value of a SQL*Plus system variable.
- 11,SHOW,
-
- 12,SHOW,
- system_variable
- 13,SHOW,
- is any system variable set by the SET command.
- 14,SHOW,
-
- 15,SHOW,
- ALL
- 16,SHOW,
- lists the settings of all SHOW options.
- 17,SHOW,
-
- 18,SHOW,
- BTI[TLE]
- 19,SHOW,
- shows the current BTITLE definition.
- 20,SHOW,
-
- 21,SHOW,
- LNO shows the current line number--the position in the current page
- 22,SHOW,
- of the display and/or spooled output.
- 23,SHOW,
-
- 24,SHOW,
- PNO shows the current page number.
- 25,SHOW,
-
- 26,SHOW,
- REL[EASE]
- 27,SHOW,
- shows the release number of ORACLE RDBMS SQL*Plus is accessing.
- 28,SHOW,
-
- 29,SHOW,
- SPOO[L]
- 30,SHOW,
- shows whether or not output is being spooled.
- 31,SHOW,
-
- 32,SHOW,
- SQLCODE
- 33,SHOW,
- shows the value of SQL.SQLCODE; for example, the SQL return code
- 34,SHOW,
- of the most recent operation.
- 35,SHOW,
-
- 36,SHOW,
- TTI[TLE]
- 37,SHOW,
- shows the current TTITLE definition.
- 38,SHOW,
-
- 39,SHOW,
- USER
- 40,SHOW,
- shows the username currently accessing SQL*Plus.
- 41,SHOW,
-
- 42,SHOW,
-
- 43,SHOW,
- Example: To list the current LINESIZE, enter:
- 44,SHOW,
-
- 45,SHOW,
- SQL> SHOW LINESIZE
- 46,SHOW,
-
- 47,SHOW,
- If the current linesize is 80 characters, SQL*Plus responds:
- 48,SHOW,
-
- 49,SHOW,
- linesize 80
- 50,SHOW,
-
- 51,SHOW,
- See also: commands, menu.
- 1,SPOOL,
-
- 2,SPOOL,
-
- 3,SPOOL,
- SPOOL
- 4,SPOOL,
-
- 5,SPOOL,
- SPO[OL] [file_name[.ext ] | OFF | OUT ]
- 6,SPOOL,
-
- 7,SPOOL,
- Use SPOOL to store query results in an operating system file, or send the
- 8,SPOOL,
- file to a default printer. SPOOL alone lists the current spooling status.
- 9,SPOOL,
-
- 10,SPOOL,
- file_name[.ext]
- 11,SPOOL,
- is the name of the file to receive the spool. SPOOL file_name
- 12,SPOOL,
- begins spooling displayed output to the named file. If you omit
- 13,SPOOL,
- an extension, SPOOL uses a default extension (usually LST or LIS).
- 14,SPOOL,
-
- 15,SPOOL,
- OFF stops spooling.
- 16,SPOOL,
-
- 17,SPOOL,
- OUT stops spooling and sends the file to your host computer's default
- 18,SPOOL,
- printer. for the current spooling status.
- 19,SPOOL,
-
- 20,SPOOL,
-
- 21,SPOOL,
- To spool output generated by commands in a command file without displaying
- 22,SPOOL,
- the output on the screen, use SET TERMOUT OFF. SET TERMOUT OFF does not
- 23,SPOOL,
- affect output from commands run interactively.
- 24,SPOOL,
-
- 25,SPOOL,
- Examples: To record your displayed output in a file named DIARY using the
- 26,SPOOL,
- default file extension, enter:
- 27,SPOOL,
-
- 28,SPOOL,
- SQL> SPOOL DIARY
- 29,SPOOL,
-
- 30,SPOOL,
- To stop spooling and print the file on your default printer:
- 31,SPOOL,
-
- 32,SPOOL,
- SQL> SPOOL OUT
- 33,SPOOL,
-
- 34,SPOOL,
- See also: commands, menu.
- 1,SQL in PL/SQL,
-
- 2,SQL in PL/SQL,
-
- 3,SQL in PL/SQL,
- SQL in PL/SQL
- 4,SQL in PL/SQL,
-
- 5,SQL in PL/SQL,
- SQL is a non-procedural relational database management system
- 6,SQL in PL/SQL,
- language that processes sets of records and provides automatic
- 7,SQL in PL/SQL,
- navigation to data. SQL enables you to specify the results you
- 8,SQL in PL/SQL,
- want without having to specify the access method to obtain the
- 9,SQL in PL/SQL,
- results. PL/SQL is a procedural language with flow of control,
- 10,SQL in PL/SQL,
- looping, cursor management, and exception handling tools.
- 11,SQL in PL/SQL,
-
- 12,SQL in PL/SQL,
- Statements - You can use any SQL data manipulation or transaction
- 13,SQL in PL/SQL,
- processing statement in PL/SQL blocks in addition to
- 14,SQL in PL/SQL,
- PL/SQL assignments (var := var + 1), flow of control
- 15,SQL in PL/SQL,
- statements (IF, GOTO, EXIT), as well as loops (LOOP,
- 16,SQL in PL/SQL,
- FOR...LOOP, WHILE...LOOP).
- 17,SQL in PL/SQL,
-
- 18,SQL in PL/SQL,
- Functions - A SQL statement in a PL/SQL block can call any SQL
- 19,SQL in PL/SQL,
- function; a PL/SQL statement in a block can call any
- 20,SQL in PL/SQL,
- SQL function except group functions.
- 21,SQL in PL/SQL,
-
- 22,SQL in PL/SQL,
- Predicates - In PL/SQL you can use all conditions of WHERE in SQL
- 23,SQL in PL/SQL,
- statements, and all SQL comparison operators.
- 24,SQL in PL/SQL,
-
- 25,SQL in PL/SQL,
- See also: loops, error handling, cursors, variables, menu.
- 1,SQL% Cursor,
-
- 2,SQL% Cursor,
-
- 3,SQL% Cursor,
- SQL% Cursor
- 4,SQL% Cursor,
-
- 5,SQL% Cursor,
- PL/SQL implicitly opens a cursor (the SQL% cursor) to process each
- 6,SQL% Cursor,
- SQL statement unassociated with an explicitly declared cursor. The
- 7,SQL% Cursor,
- SQL% cursor's attributes provide useful information about outcomes
- 8,SQL% Cursor,
- in the execution of DELETE, UPDATE, and INSERT statements:
- 9,SQL% Cursor,
-
- 10,SQL% Cursor,
- ATTRIBUTE IF ROWS ARE DELETED IF NO ROWS ARE DELETED
- 11,SQL% Cursor,
- UPDATED OR INSERTED UPDATED OR INSERTED
- 12,SQL% Cursor,
- ------------------------------------------------------------------
- 13,SQL% Cursor,
- SQL%NOTFOUND Evaluates to FALSE Evaluates to TRUE
- 14,SQL% Cursor,
-
- 15,SQL% Cursor,
- SQL%FOUND Evaluates to TRUE Evaluates to FALSE
- 16,SQL% Cursor,
-
- 17,SQL% Cursor,
- SQL%ROWCOUNT Returns the number of rows Returns a zero
- 18,SQL% Cursor,
- deleted/updated/inserted
- 19,SQL% Cursor,
-
- 20,SQL% Cursor,
-
- 21,SQL% Cursor,
- See also: declare cursor, cursors, cursor attributes, delete, update,
- 22,SQL% Cursor,
- insert, attributes (%type and %rowtype), menu.
- 1,SQLPLUS,
-
- 2,SQLPLUS,
-
- 3,SQLPLUS,
- SQLPLUS
- 4,SQLPLUS,
-
- 5,SQLPLUS,
- SQLPLUS [ [-S[ILENT] ] [logon] [start] ] | -?
- 6,SQLPLUS,
-
- 7,SQLPLUS,
- logon: username[/password][@database_specification]|/|/NOLOG
- 8,SQLPLUS,
- start: @file_name[.ext ] [arg1 arg2 .. .]
- 9,SQLPLUS,
-
- 10,SQLPLUS,
-
- 11,SQLPLUS,
- SQLPLUS starts SQL*Plus from the operating system prompt. Start enables
- 12,SQLPLUS,
- you to enter a command file name and arguments. SQL*Plus passes the
- 13,SQLPLUS,
- arguments to the command file as though you executed the file with the
- 14,SQLPLUS,
- SQL*Plus START command.
- 15,SQLPLUS,
-
- 16,SQLPLUS,
- If you omit logon and specify start, SQL*Plus assumes that the first line
- 17,SQLPLUS,
- of the command file contains a valid logon. If both start and logon are
- 18,SQLPLUS,
- omitted, SQL*Plus prompts for logon information.
- 19,SQLPLUS,
-
- 20,SQLPLUS,
- username[/password]
- 21,SQLPLUS,
- are the username and password with which to start SQL*Plus and
- 22,SQLPLUS,
- connect to ORACLE. If omitted, SQL*Plus prompts for them. If
- 23,SQLPLUS,
- you enter / (a slash) or enter RETURN to the prompt for username,
- 24,SQLPLUS,
- SQL*Plus logs you on with a default logon (see "/" below).
- 25,SQLPLUS,
-
- 26,SQLPLUS,
- / is a default (ops$) logon. In a default logon, SQL*Plus tries to
- 27,SQLPLUS,
- log on with the username OPS$name, where name is your operating
- 28,SQLPLUS,
- system username. You cannot enter a database_specification with a
- 29,SQLPLUS,
- default logon.
- 30,SQLPLUS,
-
- 31,SQLPLUS,
- /NOLOG
- 32,SQLPLUS,
- establishes no initial connection to ORACLE. Before issuing any
- 33,SQLPLUS,
- SQL commands, you must issue a CONNECT command to establish a
- 34,SQLPLUS,
- valid logon. Use /NOLOG to have a SQL*Plus command file prompt
- 35,SQLPLUS,
- the user for the name of a database.
- 36,SQLPLUS,
-
- 37,SQLPLUS,
- @database_specification
- 38,SQLPLUS,
- consists of a SQL*Net connection string; the syntax depends on the
- 39,SQLPLUS,
- SQL*Net communications protocol your Oracle installation uses.
- 40,SQLPLUS,
-
- 41,SQLPLUS,
- -S[ILENT]
- 42,SQLPLUS,
- suppresses all SQL*Plus information and prompt messages, including
- 43,SQLPLUS,
- the command prompt and the banner usually displayed when SQL*Plus
- 44,SQLPLUS,
- is started. Use SILENT to make the use of SQL*Plus invisible to
- 45,SQLPLUS,
- the user when invoking SQL*Plus within another program.
- 46,SQLPLUS,
-
- 47,SQLPLUS,
- -? makes SQLPLUS display its current version and level number, then
- 48,SQLPLUS,
- returns control to the operating system. The ? (question mark)
- 49,SQLPLUS,
- must come right after the - (hyphen); a space is not permitted.
- 50,SQLPLUS,
-
- 51,SQLPLUS,
-
- 52,SQLPLUS,
- SQL*Plus supports a Site Profile, a SQL*Plus command file created by the
- 53,SQLPLUS,
- database administrator and executed whenever a user starts SQL*Plus and
- 54,SQLPLUS,
- SQL*Plus establishes the ORACLE connection. The Site Profile enables the
- 55,SQLPLUS,
- DBA to set up SQL*Plus environment defaults for all users at a particular
- 56,SQLPLUS,
- site. Users cannot directly access the Site Profile. The default name
- 57,SQLPLUS,
- and location of the Site Profile depend on your system.
- 58,SQLPLUS,
-
- 59,SQLPLUS,
- SQL*Plus also supports a User Profile, executed after the Site Profile.
- 60,SQLPLUS,
- SQL*Plus searches for file LOGIN.SQL in your current directory. If it's
- 61,SQLPLUS,
- not there, SQL*Plus searches a system-dependent path to find the file;
- 62,SQLPLUS,
- some operating systems may not support this path-search. If the LOGIN
- 63,SQLPLUS,
- file is not found, a warning message is displayed, and the logon process
- 64,SQLPLUS,
- continues.
- 65,SQLPLUS,
-
- 66,SQLPLUS,
-
- 67,SQLPLUS,
- Examples: To start SQL*Plus with username SCOTT and password TIGER, enter:
- 68,SQLPLUS,
-
- 69,SQLPLUS,
- SQLPLUS SCOTT/TIGER
- 70,SQLPLUS,
-
- 71,SQLPLUS,
- To start SQL*Plus, as above, and to make POLICY the default
- 72,SQLPLUS,
- database, enter:
- 73,SQLPLUS,
-
- 74,SQLPLUS,
- SQLPLUS SCOTT/TIGER@POLICY
- 75,SQLPLUS,
-
- 76,SQLPLUS,
- To start SQL*Plus and run a command file named STARTUP with the
- 77,SQLPLUS,
- extension SQL, enter:
- 78,SQLPLUS,
-
- 79,SQLPLUS,
- SQLPLUS SCOTT/TIGER @STARTUP
- 80,SQLPLUS,
-
- 81,SQLPLUS,
- Note the space between TIGER and @STARTUP.
- 82,SQLPLUS,
-
- 83,SQLPLUS,
- See also: remote databases, commands, menu.
- 1,START,
-
- 2,START,
-
- 3,START,
- START
- 4,START,
-
- 5,START,
- STA[RT] file_name[.ext] [arg1 arg2 ... ]
- 6,START,
-
- 7,START,
- START executes the contents of a command file. The @ ("at" sign) command
- 8,START,
- works like START, but doesn't enable the passing of values to parameters.
- 9,START,
-
- 10,START,
- file_name[.ext]
- 11,START,
- is the command file to execute. If you omit an extension, SQL*Plus
- 12,START,
- assumes the default command-file extension (normally SQL).
- 13,START,
-
- 14,START,
- When you enter START file_name.ext, SQL*Plus searches for a file
- 15,START,
- with the specified name and extension in the current default
- 16,START,
- directory. If SQL*Plus doesn't find the file, it searches a
- 17,START,
- system-dependent path for the FROM file. Some operating systems
- 18,START,
- don't support this path-search.
- 19,START,
-
- 20,START,
- arg1 arg2 ...
- 21,START,
- are data items to be passed to parameters in the command file.
- 22,START,
- If you enter one or more arguments, SQL*Plus substitutes the
- 23,START,
- values into the parameters (&1, &2, and so forth) in the command
- 24,START,
- file. The first argument replaces each occurrence of &1, the
- 25,START,
- second replaces each occurrence of &2, and so forth.
- 26,START,
-
- 27,START,
- The START command DEFINEs the parameters with the values of the arguments;
- 28,START,
- if you START the file again in this session, you can enter new arguments
- 29,START,
- or omit the arguments to use the old values.
- 30,START,
-
- 31,START,
-
- 32,START,
- Example: File PROMOTE.SQL, used to promote employees, contains:
- 33,START,
-
- 34,START,
- SELECT * FROM EMP WHERE MGR=&1 AND JOB='&2' AND SAL>&3;
- 35,START,
-
- 36,START,
- To run this command file, enter:
- 37,START,
-
- 38,START,
- SQL> START PROMOTE 7280 CLERK 950
- 39,START,
-
- 40,START,
- SQL*Plus then executes the following command:
- 41,START,
-
- 42,START,
- SELECT * FROM EMP
- 43,START,
- WHERE MGR = 7280 AND JOB = 'CLERK' AND SAL > 950;
- 44,START,
-
- 45,START,
- See also: @, define, commands, menu.
- 1,START WITH,
-
- 2,START WITH,
-
- 3,START WITH,
- START WITH
- 4,START WITH,
- SQL clauses
- 5,START WITH,
- SELECT list FROM...
- 6,START WITH,
- WHERE...
- 7,START WITH,
- CONNECT BY PRIOR expr1 operator expr2 --displays expr1 first
- 8,START WITH,
- CONNECT BY expr1 operator PRIOR expr2 --displays expr2 first
- 9,START WITH,
- START WITH condition; --not required
- 10,START WITH,
-
- 11,START WITH,
-
- 12,START WITH,
- The START WITH condition specifies which row(s) are the root(s) of
- 13,START WITH,
- the tree. To start with each row that meets the WHERE conditions,
- 14,START WITH,
- omit the START WITH clause.
- 15,START WITH,
-
- 16,START WITH,
-
- 17,START WITH,
- See also: example connect by, conditions, connect by,
- 18,START WITH,
- tree-structured query, where, commands, menu.
- 1,Scoping Rules,
-
- 2,Scoping Rules,
-
- 3,Scoping Rules,
- Scoping Rules
- 4,Scoping Rules,
-
- 5,Scoping Rules,
- Identifiers (variables, constants, records, cursors, exceptions) are
- 6,Scoping Rules,
- local to the block in which they are declared, and global to all blocks
- 7,Scoping Rules,
- contained by that block. If you re-declare a global identifier in a
- 8,Scoping Rules,
- sub-block, the new declaration prevails in that block and in the blocks
- 9,Scoping Rules,
- it contains. Statements in a block cannot use the identifier declar-
- 10,Scoping Rules,
- ations in another block that is at the same level.
- 11,Scoping Rules,
-
- 12,Scoping Rules,
- If you've re-declared an identifier in a sub-block, and want to use the
- 13,Scoping Rules,
- higher block's declaration of that identifier, put a <<label_name>> in
- 14,Scoping Rules,
- front of the higher block's DECLARE statement, then add that label_name
- 15,Scoping Rules,
- with a period before the identifier to reference it in the sub-block.
- 16,Scoping Rules,
-
- 17,Scoping Rules,
- <<top>>
- 18,Scoping Rules,
- DECLARE
- 19,Scoping Rules,
- day DATE;
- 20,Scoping Rules,
- BEGIN
- 21,Scoping Rules,
- ...
- 22,Scoping Rules,
- DECLARE
- 23,Scoping Rules,
- day DATE;
- 24,Scoping Rules,
- BEGIN
- 25,Scoping Rules,
- IF day = top.day THEN...
- 26,Scoping Rules,
-
- 27,Scoping Rules,
- See also: identifiers, variables, blocks, declare, end, menu.
- 1,Sequences,
-
- 2,Sequences,
-
- 3,Sequences,
- Sequences
- 4,Sequences,
-
- 5,Sequences,
- A sequence is an ORACLE object from which you can generate
- 6,Sequences,
- unique integers in SQL. Sequence numbers are often used to
- 7,Sequences,
- create primary keys automatically. To use a sequence that
- 8,Sequences,
- you don't own, you must have SELECT privileges. Sequences
- 9,Sequences,
- you can access are in data dictionary views USER_SEQUENCES
- 10,Sequences,
- and ALL_SEQUENCES. The creator of a sequence sets its:
- 11,Sequences,
-
- 12,Sequences,
- Growth - A sequence may grow constantly, end at a defined
- 13,Sequences,
- limit, or restart upon reaching a defined limit.
- 14,Sequences,
-
- 15,Sequences,
- Increments - A sequence may generate numbers in ascending
- 16,Sequences,
- or descending order; the interval can be defined.
- 17,Sequences,
-
- 18,Sequences,
- The pseudo-column sequence.NEXTVAL produces the next value
- 19,Sequences,
- in a sequence; sequence.CURRVAL returns its current value.
- 20,Sequences,
-
- 21,Sequences,
-
- 22,Sequences,
-
- 23,Sequences,
- See also: keys, data dictionary, nextval, create sequence,
- 24,Sequences,
- alter sequence, drop sequence, menu.
- 1,Set Operators,
-
- 2,Set Operators,
-
- 3,Set Operators,
- Set Operators
- 4,Set Operators,
-
- 5,Set Operators,
- Set operators merge the results of multiple queries into one result.
- 6,Set Operators,
-
- 7,Set Operators,
- Operator Function in SQL Syntax
- 8,Set Operators,
- ------------------------------------------------------------------------
- 9,Set Operators,
- UNION Combines queries to return SELECT...
- 10,Set Operators,
- all distinct rows returned UNION SELECT...
- 11,Set Operators,
- by ANY individual query.
- 12,Set Operators,
-
- 13,Set Operators,
- INTERSECT Combines queries to return SELECT...
- 14,Set Operators,
- all distinct rows returned INTERSECT SELECT...
- 15,Set Operators,
- by EVERY individual query.
- 16,Set Operators,
-
- 17,Set Operators,
- MINUS Combines queries to return SELECT...
- 18,Set Operators,
- all distinct rows returned MINUS SELECT...
- 19,Set Operators,
- by the FIRST query but not
- 20,Set Operators,
- the second.
- 21,Set Operators,
-
- 22,Set Operators,
-
- 23,Set Operators,
- See also: example set, query, select, menu.
- 1,Subquery,
-
- 2,Subquery,
-
- 3,Subquery,
- Subquery
- 4,Subquery,
-
- 5,Subquery,
- A subquery is a SELECT statement used as the right-side expression
- 6,Subquery,
- within a WHERE clause--a query subordinate to another query. You
- 7,Subquery,
- can also put one subquery within another.
- 8,Subquery,
-
- 9,Subquery,
- SELECT...WHERE expr operator (SELECT...);
- 10,Subquery,
- UPDATE...WHERE expr operator (SELECT...);
- 11,Subquery,
- DELETE...WHERE expr operator (SELECT...);
- 12,Subquery,
-
- 13,Subquery,
- SELECT ename FROM emp WHERE cityname IN
- 14,Subquery,
- (SELECT id FROM city WHERE stateabbr IN
- 15,Subquery,
- (SELECT stateabbr FROM state WHERE
- 16,Subquery,
- name = 'NEW YORK'));
- 17,Subquery,
-
- 18,Subquery,
- SUBQUERY SETS
- 19,Subquery,
- SQL allows the use of a comparison operator with a multiple-value
- 20,Subquery,
- subquery if the words ANY, ALL, or SOME are after the operator.
- 21,Subquery,
-
- 22,Subquery,
- SELECT ename FROM emp
- 23,Subquery,
- WHERE job <> 'MANAGER' AND sal > ANY
- 24,Subquery,
- (SELECT sal FROM emp WHERE job='MANAGER');
- 25,Subquery,
-
- 26,Subquery,
- See also: example subquery, select, where, update, delete, comparison,
- 27,Subquery,
- query, uses of select, menu.
- 1,Substitution,
-
- 2,Substitution,
-
- 3,Substitution,
- Substitution
- 4,Substitution,
-
- 5,Substitution,
- A substitution variable is a user variable name preceded by one or two
- 6,Substitution,
- ampersands (&). When a substitution variable is in a command, SQL*Plus
- 7,Substitution,
- executes the command as though it contained the value of the substitution
- 8,Substitution,
- variable, rather than the reference to the variable.
- 9,Substitution,
-
- 10,Substitution,
- Example: If the variable SORTCOL is "JOB", and the variable MYTABLE is
- 11,Substitution,
- "EMP", SQL*Plus executes the commands:
- 12,Substitution,
-
- 13,Substitution,
- SQL> BREAK ON &SORTCOL SQL> SELECT &SORTCOL, SAL
- 14,Substitution,
- 2 FROM &MYTABLE
- 15,Substitution,
- 3 ORDER BY &SORTCOL;
- 16,Substitution,
-
- 17,Substitution,
- as if they were: SQL> BREAK ON JOB
- 18,Substitution,
- SQL> SELECT JOB, SAL
- 19,Substitution,
- 2 FROM EMP
- 20,Substitution,
- 3 ORDER BY JOB;
- 21,Substitution,
-
- 22,Substitution,
-
- 23,Substitution,
- You can use substitution variables anywhere in SQL and SQL*Plus commands,
- 24,Substitution,
- except as the first word entered at the prompt. If SQL*Plus finds an
- 25,Substitution,
- undefined substitution variable in a command, you are asked for its value.
- 26,Substitution,
-
- 27,Substitution,
- Example: If the variable GIVENNAME is undefined and you enter:
- 28,Substitution,
-
- 29,Substitution,
- SQL> SELECT * FROM EMP WHERE ENAME = '&GIVENNAME';
- 30,Substitution,
-
- 31,Substitution,
- SQL*Plus displays the prompt:
- 32,Substitution,
-
- 33,Substitution,
- Enter value for givenname:
- 34,Substitution,
-
- 35,Substitution,
-
- 36,Substitution,
- You can enter any string at the prompt, even with blanks and punctuation.
- 37,Substitution,
- Quote marks are not needed if they surround the substitution variable in
- 38,Substitution,
- the command. SQL*Plus reads your response from the keyboard, even if you
- 39,Substitution,
- have redirected terminal input or output to a file. If a terminal is not
- 40,Substitution,
- available (running the file in batch mode, for example), SQL*Plus uses the
- 41,Substitution,
- redirected file. To append characters immediately after a substitution
- 42,Substitution,
- variable, use a period to separate the variable from the characters:
- 43,Substitution,
-
- 44,Substitution,
- SQL> SELECT * FROM EMP WHERE EMPNO='&E.01';
- 45,Substitution,
- Entering a value for E: 123
- 46,Substitution,
-
- 47,Substitution,
- is interpreted as:
- 48,Substitution,
- SQL> SELECT * FROM EMP WHERE EMPNO='12301';
- 49,Substitution,
-
- 50,Substitution,
- & and &&
- 51,Substitution,
-
- 52,Substitution,
- If you use a substitution variable with one ampersand, SQL*Plus does not
- 53,Substitution,
- implicitly DEFINE the variable when you input a value. Thus, if SQL*Plus
- 54,Substitution,
- later executes the same command (or another one with the same substitution
- 55,Substitution,
- variable), SQL*Plus will prompt you again for the value of the variable.
- 56,Substitution,
- If you use a substitution variable with two ampersands, the variable is
- 57,Substitution,
- automatically defined when you input a value. Thus, if the same command
- 58,Substitution,
- is executed later in that session, SQL*Plus will not prompt you again for
- 59,Substitution,
- the value of the variable.
- 60,Substitution,
-
- 61,Substitution,
- Example: A command file named STATS (for calculating subgroup statistics
- 62,Substitution,
- on a numeric column) contains:
- 63,Substitution,
-
- 64,Substitution,
- SELECT &&GROUP_COL, MAX(&&NUMBER_COL) MAXIMUM,
- 65,Substitution,
- MIN(&&NUMBER_COL) MINIMUM,
- 66,Substitution,
- SUM(&&NUMBER_COL) TOTAL,
- 67,Substitution,
- AVG(&&NUMBER_COL) AVERAGE
- 68,Substitution,
- FROM &TABLE
- 69,Substitution,
- GROUP BY &&GROUP_COL;
- 70,Substitution,
-
- 71,Substitution,
- When you run this file, SQL*Plus prompts you for the values, by
- 72,Substitution,
- name, before running the file:
- 73,Substitution,
-
- 74,Substitution,
- Enter value for group_col: PROJNO
- 75,Substitution,
- Enter value for number_col: SAL
- 76,Substitution,
- Enter value for table: EMP
- 77,Substitution,
-
- 78,Substitution,
- SQL*Plus runs the following query:
- 79,Substitution,
-
- 80,Substitution,
- SELECT PROJNO, MAX(SAL) MAXIMUM,
- 81,Substitution,
- MIN(SAL) MINIMUM,
- 82,Substitution,
- SUM(SAL) TOTAL,
- 83,Substitution,
- AVG(SAL) AVERAGE
- 84,Substitution,
- FROM EMP
- 85,Substitution,
- GROUP BY PROJNO;
- 86,Substitution,
-
- 87,Substitution,
- If you run the query again during the same session, you will be
- 88,Substitution,
- prompted for TABLE (its name has a single ampersand) but not for
- 89,Substitution,
- GROUP_COL or NUMBER_COL (their names have double ampersands).
- 90,Substitution,
-
- 91,Substitution,
-
- 92,Substitution,
- Restrictions on Substitution
- 93,Substitution,
-
- 94,Substitution,
- You can't use substitution variables or parameters in the editing commands
- 95,Substitution,
- APPEND, CHANGE, DEL, and INPUT, nor in other commands where substitution
- 96,Substitution,
- would be meaningless, like HELP, REMARK, and TIMING. APPEND, CHANGE, and
- 97,Substitution,
- INPUT treat text beginning with & or && like any other text string.
- 98,Substitution,
-
- 99,Substitution,
- These SET variables affect substitution variables and parameters:
- 100,Substitution,
-
- 101,Substitution,
- SET SCAN turns substitution on and off.
- 102,Substitution,
-
- 103,Substitution,
- SET DEFINE defines the substitution character. & is the default.
- 104,Substitution,
-
- 105,Substitution,
- SET ESCAPE defines an escape character to use before the substitution
- 106,Substitution,
- character. The escape character instructs SQL*Plus to treat
- 107,Substitution,
- the substitution character as an ordinary character, not a
- 108,Substitution,
- variable substitution request. \ is the default character.
- 109,Substitution,
-
- 110,Substitution,
- SET VERIFY ON shows each line of the file before and after substitution.
- 111,Substitution,
-
- 112,Substitution,
- SET CONCAT defines the character between the name of a substitution
- 113,Substitution,
- variable or parameter and characters immediately after the
- 114,Substitution,
- variable or parameter (. is the default). See SET.
- 115,Substitution,
-
- 116,Substitution,
- See also: &, commands, menu.
- 1,Synonyms,
-
- 2,Synonyms,
-
- 3,Synonyms,
- Synonyms
- 4,Synonyms,
-
- 5,Synonyms,
- A synonym is an additional name for a table, view, or sequence.
- 6,Synonyms,
- Use a synonym for security and convenience to access a table or
- 7,Synonyms,
- view without needing to name the owner or the database in which
- 8,Synonyms,
- the table or view exists. A synonym is made public or private
- 9,Synonyms,
- upon creation. The name of a private synonym must be distinct
- 10,Synonyms,
- from the names of other objects owned by the same user. The SQL
- 11,Synonyms,
- statement CREATE SYNONYM is used to produce synonyms.
- 12,Synonyms,
-
- 13,Synonyms,
-
- 14,Synonyms,
-
- 15,Synonyms,
- See also: table, view, sequence, create synonym, commands, menu.
- 1,TIMING,
-
- 2,TIMING,
-
- 3,TIMING,
- TIMING
- 4,TIMING,
-
- 5,TIMING,
- TIMI[NG] [START text|SHOW|STOP]
- 6,TIMING,
-
- 7,TIMING,
- TIMING records timing data for an elapsed time period, lists the current
- 8,TIMING,
- timing area's title and timing data, or lists the number of active timing
- 9,TIMING,
- areas.
- 10,TIMING,
-
- 11,TIMING,
- START text
- 12,TIMING,
- sets up a timing area and makes text its title. To have more than
- 13,TIMING,
- one active timing area, START additional areas before STOPping the
- 14,TIMING,
- first; SQL*Plus nests each new area within the preceding one. The
- 15,TIMING,
- area most recently STARTed is the current timing area.
- 16,TIMING,
-
- 17,TIMING,
- SHOW
- 18,TIMING,
- shows the current timing area's title and timing data.
- 19,TIMING,
-
- 20,TIMING,
- STOP
- 21,TIMING,
- shows the current timing area's title and timing data, then erases
- 22,TIMING,
- the timing area. If other timing areas are active, the next most
- 23,TIMING,
- recently STARTed area becomes the current timing area. Use the
- 24,TIMING,
- CLEAR command's TIMING clause to delete all timing areas. Enter
- 25,TIMING,
- TIMING with no clauses to list the number of active timing areas.
- 26,TIMING,
-
- 27,TIMING,
-
- 28,TIMING,
- You can use this data to do a performance analysis on commands or blocks
- 29,TIMING,
- run during the period. SET TIMING ON automatically displays timing data
- 30,TIMING,
- after each SQL command or PL/SQL block you run.
- 31,TIMING,
-
- 32,TIMING,
- Examples: To create a timing area named SQL_AREA, enter:
- 33,TIMING,
-
- 34,TIMING,
- SQL> TIMING START SQL_AREA
- 35,TIMING,
-
- 36,TIMING,
- To list the current timing area's title and accumulated time:
- 37,TIMING,
-
- 38,TIMING,
- SQL> TIMING SHOW
- 39,TIMING,
-
- 40,TIMING,
- To list the current timing area's title and accumulated time,
- 41,TIMING,
- and remove the timing area, enter:
- 42,TIMING,
-
- 43,TIMING,
- SQL> TIMING STOP
- 44,TIMING,
-
- 45,TIMING,
- See also: clear, show, set, start, commands, menu.
- 1,TTITLE,
-
- 2,TTITLE,
-
- 3,TTITLE,
- TTITLE
- 4,TTITLE,
-
- 5,TTITLE,
- TTI[TLE] [printspec [text|variable] ...] | [OFF|ON]
- 6,TTITLE,
-
- 7,TTITLE,
- where printspec is one or more of the clauses:
- 8,TTITLE,
-
- 9,TTITLE,
- COL n LE[FT] BOLD
- 10,TTITLE,
- S[KIP] [n] CE[NTER] FORMAT char
- 11,TTITLE,
- TAB n R[IGHT]
- 12,TTITLE,
-
- 13,TTITLE,
- TTITLE places and formats a title at the top of each report page. Enter
- 14,TTITLE,
- TTITLE with no clause to list its current definition. See OLD TTITLE for
- 15,TTITLE,
- a description of the old form, compatible with UFI.
- 16,TTITLE,
-
- 17,TTITLE,
- If you don't enter a printspec clause before the first occurrence of text,
- 18,TTITLE,
- TTITLE left-justifies the text. TTITLE's terms and clauses also apply to
- 19,TTITLE,
- the BTITLE command.
- 20,TTITLE,
-
- 21,TTITLE,
- text
- 22,TTITLE,
- is the title text. Enter text in single quotes if you wish to
- 23,TTITLE,
- place more than one word on a single line.
- 24,TTITLE,
-
- 25,TTITLE,
- variable
- 26,TTITLE,
- is a user variable or any of these system-maintained values:
- 27,TTITLE,
-
- 28,TTITLE,
- SQL.LNO current line number
- 29,TTITLE,
- SQL.PNO current page number
- 30,TTITLE,
- SQL.RELEASE current ORACLE release number
- 31,TTITLE,
- SQL.SQLCODE current error code
- 32,TTITLE,
- SQL.USER current username
- 33,TTITLE,
-
- 34,TTITLE,
- To print one of these values, reference the appropriate variable
- 35,TTITLE,
- in the title. You can format variable with the FORMAT clause.
- 36,TTITLE,
-
- 37,TTITLE,
- OFF turns the title off (suppresses its display) without affecting
- 38,TTITLE,
- its definition.
- 39,TTITLE,
-
- 40,TTITLE,
- ON turns the title on (restores its display). When you define a
- 41,TTITLE,
- top title, SQL*Plus automatically sets TTITLE to ON.
- 42,TTITLE,
-
- 43,TTITLE,
- COL n
- 44,TTITLE,
- indents to column n of the current line (backward if column n has
- 45,TTITLE,
- been passed). "Column" here is print position, not table column.
- 46,TTITLE,
-
- 47,TTITLE,
- S[KIP] [n]
- 48,TTITLE,
- skips to the start of a new line n times; if n omitted, one time.
- 49,TTITLE,
- If n = 0, skips backward to the start of the current line.
- 50,TTITLE,
-
- 51,TTITLE,
- TAB n
- 52,TTITLE,
- skips forward n columns (backward if you enter a negative value
- 53,TTITLE,
- for n). "Column" here is print position, not table column.
- 54,TTITLE,
-
- 55,TTITLE,
- LE[FT], CE[NTER], and R[IGHT]
- 56,TTITLE,
- aligns data left, center, or right on the current line. SQL*Plus
- 57,TTITLE,
- aligns the following data items as a group, up to the end of the
- 58,TTITLE,
- printspec or the next LEFT, CENTER, RIGHT, or COL command. CENTER
- 59,TTITLE,
- and RIGHT use the SET LINESIZE value to calculate the position of
- 60,TTITLE,
- the data item that follows.
- 61,TTITLE,
-
- 62,TTITLE,
- BOLD
- 63,TTITLE,
- prints data in bold print. SQL*Plus represents bold print on your
- 64,TTITLE,
- terminal by repeating the data on three consecutive lines.
- 65,TTITLE,
-
- 66,TTITLE,
- FORMAT char
- 67,TTITLE,
- specifies a format model that determines the format data items to
- 68,TTITLE,
- the next FORMAT clause or the end of the command. The format
- 69,TTITLE,
- model must be a char constant like A10 or $999, not a variable.
- 70,TTITLE,
- See COLUMN FORMAT for more information on formatting.
- 71,TTITLE,
-
- 72,TTITLE,
- If the datatype of the format model does not match the datatype of
- 73,TTITLE,
- a given data item, the FORMAT clause has no effect on that item.
- 74,TTITLE,
-
- 75,TTITLE,
- If no FORMAT model precedes a given data item, SQL*Plus prints
- 76,TTITLE,
- NUMBER values in the format specified by SET NUMFORMAT or, if you
- 77,TTITLE,
- have not used SET NUMFORMAT, the default format. SQL*Plus prints
- 78,TTITLE,
- DATE values in the default format.
- 79,TTITLE,
-
- 80,TTITLE,
-
- 81,TTITLE,
- SQL*Plus interprets TTITLE in the new form if a valid printspec clause
- 82,TTITLE,
- (LEFT, SKIP, COL, etc.) immediately follows the command name. See COLUMN
- 83,TTITLE,
- NEW_VALUE for information on printing column and DATE values in the top
- 84,TTITLE,
- title. You can use any number of constants and variables in a printspec.
- 85,TTITLE,
- SQL*Plus displays the constants and variables in the order specified,
- 86,TTITLE,
- positioning and formatting each constant or variable by the printspec
- 87,TTITLE,
- clause that precedes it.
- 88,TTITLE,
-
- 89,TTITLE,
- Examples: To define "Monthly Analysis" as the top title and left-align it,
- 90,TTITLE,
- to center the date, to right-align the page number with a three
- 91,TTITLE,
- digit format, and to display "Date in Thousands" bold in the
- 92,TTITLE,
- center of the next line, enter:
- 93,TTITLE,
-
- 94,TTITLE,
- SQL> TTITLE LEFT 'Monthly Analysis' CENTER '11 Mar 88' -
- 95,TTITLE,
- > RIGHT 'Page:' FORMAT 999 SQL.PNO SKIP CENTER BOLD -
- 96,TTITLE,
- > 'Data in Thousands'
- 97,TTITLE,
-
- 98,TTITLE,
- The following title results:
- 99,TTITLE,
-
- 100,TTITLE,
- Monthly Analysis 11 Mar 88 Page: 1
- 101,TTITLE,
- Data in Thousands
- 102,TTITLE,
-
- 103,TTITLE,
- To suppress the top title display without changing its
- 104,TTITLE,
- definition, enter:
- 105,TTITLE,
-
- 106,TTITLE,
- SQL> TTITLE OFF
- 107,TTITLE,
-
- 108,TTITLE,
- See also: btitle, set, commands, menu.
- 1,Tables,
-
- 2,Tables,
-
- 3,Tables,
- Tables, Columns, and Rows
- 4,Tables,
-
- 5,Tables,
- Database data is stored in tables, made of columns and rows.
- 6,Tables,
- A table with one column holds a list of items. A table with
- 7,Tables,
- two or more columns interrelates the information held by the
- 8,Tables,
- columns of each row.
- 9,Tables,
-
- 10,Tables,
- Each column represents a single attribute for each row. Each
- 11,Tables,
- row stores the data of one record with a unique ROWID pseudo-
- 12,Tables,
- column. One or more columns of a table may serve as primary,
- 13,Tables,
- foreign, or unique keys. Tables and columns are referenced by
- 14,Tables,
- their identifiers: emp.sal
- 15,Tables,
-
- 16,Tables,
-
- 17,Tables,
-
- 18,Tables,
- See also: pseudo-columns, identifiers, keys, create table,
- 19,Tables,
- alter table, drop table, constraints, menu.
- 1,Transactions,
-
- 2,Transactions,
-
- 3,Transactions,
- Transactions
- 4,Transactions,
-
- 5,Transactions,
- A transaction in SQL is a series of statements treated as a logical
- 6,Transactions,
- unit of work. A transaction is either made permanent with a COMMIT
- 7,Transactions,
- or completely undone with a ROLLBACK to a SAVEPOINT. A transaction
- 8,Transactions,
- begins with the first statement executed, or the first one executed
- 9,Transactions,
- since the last COMMIT or ROLLBACK. It ends with the next COMMIT or
- 10,Transactions,
- ROLLBACK statement.
- 11,Transactions,
-
- 12,Transactions,
- You may wish to insert a SET TRANSACTION READ ONLY statement at the
- 13,Transactions,
- beginning of a transaction to prevent changes by other users.
- 14,Transactions,
-
- 15,Transactions,
-
- 16,Transactions,
-
- 17,Transactions,
- See also: commit, rollback, savepoint, set transaction, menu.
- 1,Tree-Structured Query,
-
- 2,Tree-Structured Query,
-
- 3,Tree-Structured Query,
- Tree-Structured Query
- 4,Tree-Structured Query,
-
- 5,Tree-Structured Query,
- A tree-structured query uses the CONNECT BY clause to display rows
- 6,Tree-Structured Query,
- in a hierarchical order. Beginning with the root node named in the
- 7,Tree-Structured Query,
- START WITH clause, the query inspects each branch connected to the
- 8,Tree-Structured Query,
- root. For example, the emp table lists a manager for each employee
- 9,Tree-Structured Query,
- except KING, the president:
- 10,Tree-Structured Query,
-
- 11,Tree-Structured Query,
- Level 1 KING (the root node)
- 12,Tree-Structured Query,
- |-----------|----------------------|
- 13,Tree-Structured Query,
- | | |
- 14,Tree-Structured Query,
- Level 2 CLARK JONES BLAKE
- 15,Tree-Structured Query,
- | |---|---| |-----|------|-------|-------|
- 16,Tree-Structured Query,
- | | | | | | | |
- 17,Tree-Structured Query,
- Level 3 MILLER SCOTT FORD ALLEN WARD MARTIN TURNER JAMES
- 18,Tree-Structured Query,
- | |
- 19,Tree-Structured Query,
- | |
- 20,Tree-Structured Query,
- Level 4 ADAMS SMITH
- 21,Tree-Structured Query,
-
- 22,Tree-Structured Query,
-
- 23,Tree-Structured Query,
-
- 24,Tree-Structured Query,
- See also: example connect by, select, query, uses of select, menu.
- 1,UNDEFINE,
-
- 2,UNDEFINE,
-
- 3,UNDEFINE,
- UNDEFINE
- 4,UNDEFINE,
-
- 5,UNDEFINE,
- UNDEF[INE] variable
- 6,UNDEFINE,
-
- 7,UNDEFINE,
- UNDEFINE deletes a given user variable that you defined either explicitly
- 8,UNDEFINE,
- (with the DEFINE command), or implicitly (with a START command argument).
- 9,UNDEFINE,
-
- 10,UNDEFINE,
- variable
- 11,UNDEFINE,
- is the name of the user variable you wish to delete.
- 12,UNDEFINE,
-
- 13,UNDEFINE,
-
- 14,UNDEFINE,
- Example: To undefine a user variable named POS, enter:
- 15,UNDEFINE,
-
- 16,UNDEFINE,
- SQL> UNDEFINE POS
- 17,UNDEFINE,
-
- 18,UNDEFINE,
- See also: define, start, @, commands, menu.
- 1,UPDATE,
-
- 2,UPDATE,
-
- 3,UPDATE,
- UPDATE
- 4,UPDATE,
- SQL and PL/SQL statement
- 5,UPDATE,
-
- 6,UPDATE,
- UPDATE table/view_name SET
- 7,UPDATE,
- column_name = sql_expression --SQL option
- 8,UPDATE,
- column_name = (one_value_SELECT_statement) --SQL option
- 9,UPDATE,
- (column_name, column_name,...) = SELECT_statement --SQL option
- 10,UPDATE,
- WHERE_clause;
- 11,UPDATE,
- WHERE CURRENT OF cursor_name; --PL/SQL option
- 12,UPDATE,
-
- 13,UPDATE,
- UPDATE replaces the values in rows of one or more specified columns
- 14,UPDATE,
- with the values from a SQL expression or a SELECT statement. SELECT
- 15,UPDATE,
- must return at least one row, and every column to the left of the =
- 16,UPDATE,
- sign. SELECT may not contain an INTO clause. Use the WHERE clause
- 17,UPDATE,
- to specify conditions rows must meet in order to be updated; if you
- 18,UPDATE,
- omit the WHERE clause, all rows are updated.
- 19,UPDATE,
-
- 20,UPDATE,
- In PL/SQL, WHERE CURRENT OF updates the current row.
- 21,UPDATE,
-
- 22,UPDATE,
-
- 23,UPDATE,
- See also: example rollback, cursors, where current of, sql% cursor,
- 24,UPDATE,
- example where current of, select, commands, menu.
- 1,User ID,
-
- 2,User ID,
-
- 3,User ID,
- User ID
- 4,User ID,
-
- 5,User ID,
- A user is identified by a name and a password that gives access
- 6,User ID,
- to the database. A user may be the owner of tables, views, and
- 7,User ID,
- sequences and may be granted SELECT, INSERT, DELETE, and UPDATE
- 8,User ID,
- privileges for tables, views, and sequences owned by others. A
- 9,User ID,
- user with DBA privileges uses the GRANT statement to create user
- 10,User ID,
- accesses and privileges.
- 11,User ID,
-
- 12,User ID,
-
- 13,User ID,
-
- 14,User ID,
- See also: grant, select, insert, delete, update, dba, menu.
- 1,Uses of SELECT,
-
- 2,Uses of SELECT,
-
- 3,Uses of SELECT,
- Uses of SELECT
- 4,Uses of SELECT,
-
- 5,Uses of SELECT,
- The SELECT statement shows the syntax of clauses used in SELECT
- 6,Uses of SELECT,
- and other SQL statements. The topics below provide information
- 7,Uses of SELECT,
- on some of the many uses of the SELECT statement. To display a
- 8,Uses of SELECT,
- topic, enter help and a space, then part or all of the topic
- 9,Uses of SELECT,
- name.
- 10,Uses of SELECT,
-
- 11,Uses of SELECT,
- select list correlated subquery
- 12,Uses of SELECT,
-
- 13,Uses of SELECT,
- join (simple) distributed query
- 14,Uses of SELECT,
-
- 15,Uses of SELECT,
- outer join tree-structured query
- 16,Uses of SELECT,
-
- 17,Uses of SELECT,
- query select into (PL/SQL)
- 18,Uses of SELECT,
-
- 19,Uses of SELECT,
- subquery cursors (PL/SQL)
- 20,Uses of SELECT,
-
- 21,Uses of SELECT,
-
- 22,Uses of SELECT,
-
- 23,Uses of SELECT,
- See also: select, commands, examples, menu.
- 1,VALIDATE INDEX,
-
- 2,VALIDATE INDEX,
-
- 3,VALIDATE INDEX,
- VALIDATE INDEX
- 4,VALIDATE INDEX,
- SQL statement
- 5,VALIDATE INDEX,
- VALIDATE INDEX user.index
- 6,VALIDATE INDEX,
-
- 7,VALIDATE INDEX,
-
- 8,VALIDATE INDEX,
- VALIDATE INDEX verifies that each index entry points to the correct data
- 9,VALIDATE INDEX,
- block. It does not confirm that each row has an appropriate index entry.
- 10,VALIDATE INDEX,
- If ORACLE doesn't give a message that the index has been validated, drop
- 11,VALIDATE INDEX,
- and recreate the index.
- 12,VALIDATE INDEX,
-
- 13,VALIDATE INDEX,
-
- 14,VALIDATE INDEX,
- See also: create index, alter index, commands, menu.
- 1,Variables,
-
- 2,Variables,
-
- 3,Variables,
- Variables
- 4,Variables,
-
- 5,Variables,
- Use variables to store the results of a query, or to calculate
- 6,Variables,
- values to insert into tables. You can declare a variable to be
- 7,Variables,
- of any SQL or PL/SQL datatype: NUMBER, CHAR, DATE, or BOOLEAN.
- 8,Variables,
- Examples: balance NUMBER(5,2); wkphone CHAR(12); sex BOOLEAN
- 9,Variables,
-
- 10,Variables,
- There are two ways you can assign values to a variable:
- 11,Variables,
-
- 12,Variables,
- - use := (the assignment operator)
- 13,Variables,
- discount := price * 0.15
- 14,Variables,
-
- 15,Variables,
- - SELECT or FETCH table values INTO a variable:
- 16,Variables,
- SELECT price * 0.15 INTO discount FROM pricelist
- 17,Variables,
- WHERE stockdate <= SYSDATE - 60
- 18,Variables,
-
- 19,Variables,
- To declare a constant, put CONSTANT after the name and assign
- 20,Variables,
- its value immediately: discount CONSTANT NUMBER(2,2) := 0.15;
- 21,Variables,
-
- 22,Variables,
-
- 23,Variables,
- See also: declare, number, char, date, boolean, select into,
- 24,Variables,
- fetch, commands, menu.
- 1,Views,
-
- 2,Views,
-
- 3,Views,
- Views (and Indexes)
- 4,Views,
-
- 5,Views,
- A view contains no data, but provides a representation of data in
- 6,Views,
- one or more tables (base tables) or other views. Views let you:
- 7,Views,
-
- 8,Views,
- - Restrict access to the data in some columns and/or rows.
- 9,Views,
- - Hide data complexity--you can use a single view to access
- 10,Views,
- the information in several tables.
- 11,Views,
- - Reduce syntactic complexity--a view of data from multiple
- 12,Views,
- tables can return information without join operations.
- 13,Views,
- - Present data from alternative perspectives--you can rename
- 14,Views,
- view columns without changing base table column names.
- 15,Views,
-
- 16,Views,
- An index provides quick access to rows; SQL commands that process
- 17,Views,
- less than 25% of a table's rows will perform faster with an index.
- 18,Views,
-
- 19,Views,
- A unique index guarantees the uniqueness of rows in a table by not
- 20,Views,
- allowing duplicates in one of the columns (the primary key).
- 21,Views,
-
- 22,Views,
-
- 23,Views,
- See also: tables, keys, create view, create index, menu.
- 1,WHENEVER SQLERROR,
-
- 2,WHENEVER SQLERROR,
-
- 3,WHENEVER SQLERROR,
- WHENEVER SQLERROR
- 4,WHENEVER SQLERROR,
-
- 5,WHENEVER SQLERROR,
- WHENEVER SQLERROR {EXIT [SUCCESS|FAILURE|WARNING|n|variable]|CONTINUE}
- 6,WHENEVER SQLERROR,
-
- 7,WHENEVER SQLERROR,
- WHENEVER SQLERROR exits SQL*Plus if a SQL command or PL/SQL block causes
- 8,WHENEVER SQLERROR,
- an error.
- 9,WHENEVER SQLERROR,
-
- 10,WHENEVER SQLERROR,
- EXIT [SUCCESS | FAILURE | WARNING | n | variable]
- 11,WHENEVER SQLERROR,
- directs SQL*Plus to commit pending changes to the database and
- 12,WHENEVER SQLERROR,
- exit when a SQL error is detected. The EXIT clause has the syntax
- 13,WHENEVER SQLERROR,
- of the EXIT command. SQL*Plus command errors don't cause an exit.
- 14,WHENEVER SQLERROR,
-
- 15,WHENEVER SQLERROR,
- CONTINUE
- 16,WHENEVER SQLERROR,
- turns off the EXIT option.
- 17,WHENEVER SQLERROR,
-
- 18,WHENEVER SQLERROR,
- Examples: These commands cause an exit and display the SQL error code if
- 19,WHENEVER SQLERROR,
- a SQL UPDATE command fails and skips the COPY command:
- 20,WHENEVER SQLERROR,
-
- 21,WHENEVER SQLERROR,
- SQL> GET RAISE
- 22,WHENEVER SQLERROR,
- 1 WHENEVER SQLERROR EXIT SQL.SQLCODE
- 23,WHENEVER SQLERROR,
- 2 UPDATE EMP SET SAL = SAL*1.1
- 24,WHENEVER SQLERROR,
- 3 COPY TO SCOTT/TIGER@D:BETHESDA -
- 25,WHENEVER SQLERROR,
- 4 REPLACE EMP -
- 26,WHENEVER SQLERROR,
- 5 USING SELECT * FROM EMP
- 27,WHENEVER SQLERROR,
- 6 WHENEVER SQLERROR CONTINUE
- 28,WHENEVER SQLERROR,
-
- 29,WHENEVER SQLERROR,
- See also: example error handling, exit, commands, menu.
- 1,WHERE,
-
- 2,WHERE,
- WHERE
- 3,WHERE,
- SQL clause
- 4,WHERE,
-
- 5,WHERE,
- SELECT ... UPDATE ... DELETE ...
- 6,WHERE,
- WHERE condition WHERE condition WHERE condition
- 7,WHERE,
-
- 8,WHERE,
-
- 9,WHERE,
- Based on the set of conditions specified, the WHERE clause decides
- 10,WHERE,
- which rows in a table to SELECT, UPDATE, or DELETE. The condition
- 11,WHERE,
- contains the name of a column, a comparison operator, and criteria
- 12,WHERE,
- of the same datatype as the column. You may use logical operators
- 13,WHERE,
- in a condition as well-- NOT reverses the meaning of the criteria;
- 14,WHERE,
- AND requires that several criteria be met; OR picks rows that meet
- 15,WHERE,
- any one criteria in a list. For example, to find clients who have
- 16,WHERE,
- balances over $100 overdue 90 days or more:
- 17,WHERE,
-
- 18,WHERE,
- SELECT * FROM clients WHERE bal > 100 AND SYSDATE - duedate >= 90;
- 19,WHERE,
-
- 20,WHERE,
-
- 21,WHERE,
- See also: subquery, select, update, delete, conditions, comparison,
- 22,WHERE,
- logical operators, commands, menu.
- 1,WHERE CURRENT OF,
-
- 2,WHERE CURRENT OF,
-
- 3,WHERE CURRENT OF,
- WHERE CURRENT OF
- 4,WHERE CURRENT OF,
- PL/SQL clause
- 5,WHERE CURRENT OF,
-
- 6,WHERE CURRENT OF,
- Use the WHERE CURRENT OF cursor_name clause in a PL/SQL program
- 7,WHERE CURRENT OF,
- to UPDATE or DELETE the current row--the one last accessed with
- 8,WHERE CURRENT OF,
- a FETCH statement; the named cursor must be open and positioned
- 9,WHERE CURRENT OF,
- on a row. To use WHERE CURRENT OF, FOR UPDATE OF must have been
- 10,WHERE CURRENT OF,
- used in the declaration of the cursor's query.
- 11,WHERE CURRENT OF,
-
- 12,WHERE CURRENT OF,
-
- 13,WHERE CURRENT OF,
- The implicit SQL% cursor and explicit cursor attributes let you
- 14,WHERE CURRENT OF,
- access useful information about the execution of an UPDATE or a
- 15,WHERE CURRENT OF,
- DELETE statement.
- 16,WHERE CURRENT OF,
-
- 17,WHERE CURRENT OF,
-
- 18,WHERE CURRENT OF,
- See also: example where current of, update, delete, for update of,
- 19,WHERE CURRENT OF,
- cursors, SQL% cursor, cursor attributes, commands, menu.
- 1,WHILE,
-
- 2,WHILE,
-
- 3,WHILE,
- WHILE
- 4,WHILE,
- PL/SQL statement
- 5,WHILE,
-
- 6,WHILE,
- WHILE condition LOOP
- 7,WHILE,
- sequence_of_statements
- 8,WHILE,
- END LOOP;
- 9,WHILE,
-
- 10,WHILE,
-
- 11,WHILE,
- In a WHILE loop, as long as the condition evaluates to TRUE at the
- 12,WHILE,
- start of each iteration, the sequence_of_statements is executed.
- 13,WHILE,
- The loop terminates once the condition evaluates to FALSE or NULL.
- 14,WHILE,
-
- 15,WHILE,
-
- 16,WHILE,
- For other loops see: loop, cursor for, numeric for.
- 17,WHILE,
-
- 18,WHILE,
-
- 19,WHILE,
- See also: example while, conditions, boolean comparisons, commands.
-