'feedback' shows how many records were selected if it exceeds a certain amount
feedback 显示有多少条记录被选择,如果条数超过给定的feedback 值。
例:
SQL> set feedback off;
SQL> /
NAME ID
---------- ----------
a 1
b 1
SQL> set feedback on;
SQL> /
NAME ID
---------- ----------
a 1
b 1
已选择2行。 -----不同就在这里。
SQL> set feedback 3; ----设置feedback 为3
SQL> /
NAME ID
---------- ----------
a 1
b 1 -------记录数为2,小于3,所以不显示“已选择2行。”
SQL> set heading off;
a 1
b 1
SQL> set heading on;
NAME ID ------不同就在这里
---------- ---------- ----- 不同就在这里
a 1
b 1
参考:http://www.java2s.com/Tutorial/Oracle/0580__SQL-PLUS-Session-Environment/setfeedbackonoff.htm
SQL> set feedback 1; ----设置feedback 为1
NAME ID
---------- ----------
a 1
b 1
已选择2行。 ----显示
示例:
-- Execute this SQL file to build and load
-- the simple table for Chapter 1
SET FEEDBACK OFF
PROMPT Chapter 1 ----输出“Chapter 1”
PROMPT ----输入空一行
SET TERMOUT OFF ----关闭TEAMOUT,执行sql文件的过程不显示在sqlplus中
DROP TABLE Clients CASCADE CONSTRAINTS PURGE;
CREATE TABLE Clients (
ClientID INTEGER NOT NULL,
FirstName NVARCHAR2(30),
LastName NVARCHAR2(30),
Category NVARCHAR2(20),
Balance NUMBER(38,4),
CONSTRAINT pk_Clients PRIMARY KEY (ClientID)
);
INSERT INTO Clients VALUES (101, 'Stanley', 'Best', 'Builder', 157.32);
INSERT INTO Clients VALUES (102, 'Jack', 'Kostantaras', 'Banker', 1153.11);
INSERT INTO Clients VALUES (103, 'Terrence', 'Gerson', 'Builder', 3521.33);
INSERT INTO Clients VALUES (104, 'Robert', 'Choate', 'Dentist', 938.55);
INSERT INTO Clients VALUES (105, 'Patrick', 'Townes', 'Physician', 3938.33);
INSERT INTO Clients VALUES (106, 'Ann', 'Dattillo', 'Teacher', 114.11);
INSERT INTO Clients VALUES (107, 'Andrew', 'Bianco', 'Dentist', 7647.99);
INSERT INTO Clients VALUES (108, 'Susan', 'Galin', 'Physician', 444.22);
INSERT INTO Clients VALUES (109, 'William', 'Pauley', 'Teacher', 847.21);
INSERT INTO Clients VALUES (110, 'John', 'Kent', 'Banker', 474.33);
INSERT INTO Clients VALUES (111, 'Tracy', 'Johnson', 'Dentist', 557.87);
INSERT INTO Clients VALUES (112, 'Mark', 'Warnock', 'Teacher', 111.33);
INSERT INTO Clients VALUES (113, 'Mary', 'Kobasa', 'Builder', 847.44);
INSERT INTO Clients VALUES (114, 'Dale', 'Levenre', 'Physician', 3331.21);
INSERT INTO Clients VALUES (115, 'Peter', 'Tombros', 'Builder', 393.22);
INSERT INTO Clients VALUES (116, 'David', 'Yost', 'Physician', 786.33);
COMMIT;
SET TERMOUT ON
PROMPT Clients table created and populated.
SELECT Count(*) FROM Clients;
SET FEEDBACK ON
Clients table created and populated.
COUNT(*)
----------
16
SQL>@<path>/sql文件