oracle query output in excel file
Code:
SQL> spool emp.xls SQL> select empno||chr(9)||ename||chr(9)||job||chr(9)||mgr from emp; SQL> spool off
Code:
SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF ; SPOOL MY_TEST_FILE.xls; SELECT * FROM EMP; SPOOL OFF;
Code:
set heading off pages 0 trimspool on feedback off echo off spool c:\emp.xls select 'EMPNO'||chr(9)||'ENAME'||chr(9)||'JOB'||chr(9)||'MGR' from dual union all select empno||chr(9)||ename||chr(9)||job||chr(9)||mgr from emp; spool off
Then, from the SQL prompt:
Code:
test@ORA10G> test@ORA10G> host type c:\test.sql set heading off pages 0 trimspool on feedback off echo off spool c:\emp.xls select 'EMPNO'||chr(9)||'ENAME'||chr(9)||'JOB'||chr(9)||'MGR' from dual union all select empno||chr(9)||ename||chr(9)||job||chr(9)||mgr from emp; spool off test@ORA10G> test@ORA10G> @c:\test.sql EMPNO ENAME JOB MGR 7369 SMITH CLERK 7902 7499 ALLEN SALESMAN 7698 7521 WARD SALESMAN 7698 7566 JONES MANAGER 7839 7654 MARTIN SALESMAN 7698 7698 BLAKE MANAGER 7839 7782 CLARK MANAGER 7839 7788 SCOTT ANALYST 7566 7839 KING PRESIDENT 7844 TURNER SALESMAN 7698 7876 ADAMS CLERK 7788 7900 JAMES CLERK 7698 7902 FORD ANALYST 7566 7934 MILLER CLERK 7782 test@ORA10G>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90618/viewspace-709490/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE EBS中檢視某個Request的Output FileOracle
- Oracle Query Result CacheOracle
- oracle DBMS_OUTPUT.PUT_LINE()Oracle
- Oracle Display the process of the procedure ( oracle pipe , dbms_output , prompt )Oracle
- ORACLE Flashback Query偽列Oracle
- oracle系統包—-dbms_output用法Oracle
- oracle is not in the sudoers fileOracle
- Oracle Query processing 的程式Oracle
- Overview of Oracle Flashback Query I (366)ViewOracle
- Overview of Oracle Flashback Query II (367)ViewOracle
- Upload excel file 到 INTERNAL TABLE 的方法Excel
- C# read excel file via ExcelDataReaderC#ExcelLDA
- oracle 10g flashback version query 和 flashback transaction query實驗Oracle 10g
- Oracle ASM File DirectoryOracleASM
- oracle utl_fileOracle
- Oracle EBS ATTACHMENT with fileOracle
- OMF (Oracle Managed File)Oracle
- Oracle Password File 理解Oracle
- ORACLE 11G Flashback Versions QueryOracle
- flashback version query in oracle 10gOracle 10g
- query result cache in oracle 11gOracle
- oracle10g之flashback version query 和flashback transaction query 實驗Oracle
- 將Excel file上轉到Internal table的方法Excel
- cx_Oracle.DatabaseError: [Decode error - output not utf-8]OracleDatabaseError
- kettle從入門到精通 第五十六課 ETL之kettle Microsoft Excel OutputROSExcel
- Oracle閃回技術--Flashback Version QueryOracle
- Oracle Flashback query查詢的侷限Oracle
- Oracle10g的Flashback version QueryOracle
- Oracle Dump Redo Log FileOracle
- requirement for output typeUIREM
- [GAUSS-51808] : The env file contains errmsg: {'Node[192.168.56.181]': 'Output:AI
- Warning: Cannot modify header information - headers already sent by (output started at file_path:line)HeaderORM
- 實用且常用的FN:Upload Excel File Into Internal TableExcel
- 安裝win10系統提示Output error file to the following location A:\ghosterr.txt怎麼辦Win10Error
- Oracle:db file scattered readOracle
- Oracle ASM Cluster File Systems (ACOracleASM
- [Oracle Script] check File I/OOracle
- Oracle ACFS ( ASM Cluster File System )OracleASM