PLSQL Developer_v7_sqlplus:set head off and set head on

msdnchina發表於2010-12-02
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Connected as SYS


SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';

Session altered

SQL> EXECUTE DBMS_LOGMNR.START_LOGMNR(STARTTIME => '02-dec-2010 15:22:00', ENDTIME => '02-dec-2010 15:24:00', PTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG +DBMS_LOGMNR.CONTINUOUS_MINE);

PL/SQL procedure successfully completed

SQL> show heading
SQL> set heading on
SQL> show heading
SQL> SELECT SQL_UNDO FROM V$LOGMNR_CONTENTS WHERE  SEG_NAME = 'EMP';

SQL_UNDO
--------------------------------------------------------------------------------
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

14 rows selected

SQL> set heading off
SQL> SELECT SQL_UNDO FROM V$LOGMNR_CONTENTS WHERE  SEG_NAME = 'EMP';
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7369','SMITH','CLERK','7902',TO_DATE('17-DEC-1980 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'800',NULL,'20');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7499','ALLEN','SALESMAN','7698',TO_DATE('20-FEB-1981 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'1600','300','30');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7521','WARD','SALESMAN','7698',TO_DATE('22-FEB-1981 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'1250','500','30');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7566','JONES','MANAGER','7839',TO_DATE('02-APR-1981 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'2975',NULL,'20');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7654','MARTIN','SALESMAN','7698',TO_DATE('28-SEP-1981 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'1250','1400','30');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7698','BLAKE','MANAGER','7839',TO_DATE('01-MAY-1981 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'2850',NULL,'30');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7782','CLARK','MANAGER','7839',TO_DATE('09-JUN-1981 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'2450',NULL,'10');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7788','SCOTT','ANALYST','7566',TO_DATE('19-APR-1987 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'3000',NULL,'20');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7839','KING','PRESIDENT',NULL,TO_DATE('17-NOV-1981 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'5000',NULL,'10');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7844','TURNER','SALESMAN','7698',TO_DATE('08-SEP-1981 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'1500','0','30');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7876','ADAMS','CLERK','7788',TO_DATE('23-MAY-1987 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'1100',NULL,'20');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7900','JAMES1','CLERK','7698',TO_DATE('03-DEC-1981 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'950',NULL,'30');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7902','FORD','ANALYST','7566',TO_DATE('03-DEC-1981 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'3000',NULL,'20');
insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7934','MILLER','CLERK','7782',TO_DATE('23-JAN-1982 00:00:00', 'DD-MON-YYYY HH24:MI:SS'),'1300',NULL,'10');

14 rows selected

在 PLSQL Developer_v7_sqlplus 中,heading on時,查詢出來的記錄被截斷,
heading off時,查詢出來的記錄是全部的。

這跟cmd_sqlplus 執行相同的命令,結果不一樣。估計是PLSQL Developer_v7_sqlplus的bug???

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/161195/viewspace-680814/,如需轉載,請註明出處,否則將追究法律責任。

相關文章