SQL Plus的输出

 

'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文件

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值