티스토리 툴바

   OpenApps  
Front Page
Tag | Location | Media | Guestbook | Admin   
 
오라클 결과값 파일 저장
오라클 라이브러리 참조한 함수 및 속성

SPOOL

Syntax

SPO[OL] [file_name[.ext] [CRE[ATE] | REP[LACE] | APP[END]] | OFF | OUT]

Stores query results in a file, or optionally sends the file to a printer.

Terms

file_name[.ext]

Represents the name of the file to which you wish to spool. SPOOL followed by file_name begins spooling displayed output to the named file. If you do not specify an extension, SPOOL uses a default extension (LST or LIS on most systems). The extension is not appended to system files such as /dev/null and /dev/stderr.

CRE[ATE]

Creates a new file with the name specified.

REP[LACE]

Replaces the contents of an existing file. If the file does not exist, REPLACE creates the file. This is the default behavior.

APP[END]

Adds the contents of the buffer to the end of the file you specify.

OFF

Stops spooling.

OUT

Stops spooling and sends the file to your computer's standard (default) printer. This option is not available on some operating systems.

Enter SPOOL with no clauses to list the current spooling status.

Usage

To spool output generated by commands in a script without displaying the output on the screen, use SET TERMOUT OFF. SET TERMOUT OFF does not affect output from commands that run interactively.

You must use quotes around file names containing white space.

To create a valid HTML file using SPOOL APPEND commands, you must use PROMPT or a similar command to create the HTML page header and footer. The SPOOL APPEND command does not parse HTML tags.

SET SQLPLUSCOMPAT[IBILITY] to 9.2 or earlier to disable the CREATE, APPEND and SAVE parameters. See SQL*Plus Compatibility Matrix to determine what functionality is controlled by the SET SQLPLUSCOMPAT[IBILITY] command.

Examples of SPOOL Command

To record your output in the new file DIARY using the default file extension, enter

SPOOL DIARY CREATE

To append your output to the existing file DIARY, enter

SPOOL DIARY APPEND

To record your output to the file DIARY, overwriting the existing content, enter

SPOOL DIARY REPLACE

To stop spooling and print the file on your default printer, enter

SPOOL OUT
SPOOL 대한 잠깐 실험
SQL> spool test.txt
SQL> select * from emp;
     EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM       
---------- ---------- --------- ---------- -------- ---------- ----------      
    DEPTNO                                                                     
----------                                                                     
      7369 SMITH      CLERK           7902 80/12/17        800                 
        20                                                                     
                                                                               
      7499 ALLEN      SALESMAN        7698 81/02/20       1600        300      
        30                                                                     
                                                                               
      7521 WARD       SALESMAN        7698 81/02/22       1250        500      
        30                                                                     
                                                                               
     EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM       
---------- ---------- --------- ---------- -------- ---------- ----------      
    DEPTNO                                                                     
----------                                                                     
      7566 JONES      MANAGER         7839 81/04/02       2975                 
        20                                                                     
                                                                               
      7654 MARTIN     SALESMAN        7698 81/09/28       1250       1400      
        30                                                                     
                                                                               
      7698 BLAKE      MANAGER         7839 81/05/01       2850                 
        30                                                                     
                                                                               
     EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM       
---------- ---------- --------- ---------- -------- ---------- ----------      
    DEPTNO                                                                     
----------                                                                     
      7782 CLARK      MANAGER         7839 81/06/09       2450                 
        10                                                                     
                                                                               
      7788 SCOTT      ANALYST         7566 87/04/19       3000                 
        20                                                                     
                                                                               
      7839 KING       PRESIDENT            81/11/17       5000                 
        10                                                                     
                                                                               
     EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM       
---------- ---------- --------- ---------- -------- ---------- ----------      
    DEPTNO                                                                     
----------                                                                     
      7844 TURNER     SALESMAN        7698 81/09/08       1500          0      
        30                                                                     
                                                                               
      7876 ADAMS      CLERK           7788 87/05/23       1100                 
        20                                                                     
                                                                               
      7900 JAMES      CLERK           7698 81/12/03        950                 
        30                                                                     
                                                                               
     EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM       
---------- ---------- --------- ---------- -------- ---------- ----------      
    DEPTNO                                                                     
----------                                                                     
      7902 FORD       ANALYST         7566 81/12/03       3000                 
        20                                                                     
                                                                               
      7934 MILLER     CLERK           7782 82/01/23       1300                 
        10                                                                     
                                                                               
14 개의 행이 선택되었습니다.
SQL> spool off
저작자 표시

'Oracle' 카테고리의 다른 글

오라클 결과값 파일 저장  (0) 2010/01/13
산술연산자  (0) 2010/01/13
set linesize (라인당 출력될 문자 수)  (0) 2010/01/12
오라클의 데이터 형  (0) 2010/01/11
데이블 구조를 살펴보기 위한 DESCRIBE  (0) 2010/01/11
데이터 딕셔너리 TAB  (0) 2010/01/11
Tag : ,


BLOG main image
OS, WebLanguage, Databases
 Notice
 Category
분류 전체보기 (33)
OpenApps 이야기 (1)
SUN (8)
Oracle (21)
OAppSolution (1)
SAP (1)
 TAGS
데이터 딕셔너리 TAB context 웹어플리케이션폴더구조 oracle spool char DESC virtualbox 오라클 에러 코드 모음 text count php count Date php counter jsp count 텍스트 카운터 jsp counter 오라클의 데이터 형 윈도우7 오라클11g 설치 방법 jsp 구구단 오라클 11g 오라클 산술연산자 오라클 helloworld Oracle계정 varchar2 오라클 패스워드 Number set linesize 윈도우7 네트워크 설정 문제 오라클 데이터베이스 관리자 오라클 로그인 방법 오라클 실행 결과값 파일 저장 Oracle jsp DESCRIBE 사용자 계정 Lock/UnLock IT 월드 2009 text counter php 구구단 컨텍스트
 Calendar
«   2012/02   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      
 Recent Entries
BW 참고할만한 동영상
asfasfasf
오라클 결과값 파일 저장
산술연산자
set linesize (라인당 출력될 문자 수)
오라클의 데이터 형
데이블 구조를 살펴보기 위한 DESCRIBE
데이터 딕셔너리 TAB
사용자 계정 Lock/UnLock
오라클 패스워드 잊어버렸을때
 Recent Comments
 Recent Trackbacks
이영훈
saewooinfo
ㅁㄻㄻㄴㄹ
새우네동네
 Archive
2011/06
2011/01
2010/01
2009/12
2009/10
 Link Site
 Visitor Statistics
Total : 10,359
Today : 10
Yesterday : 12
rss