无码精品不卡一区二区三区,亚洲综合另类一区无码,亚洲AV无码乱码在线观看裸奔,在线观看无码爽视频,精品少妇无码av专区在线观看 ,免费精品无码一级毛片牛牛影视 ,91天堂在线观看无码

在線咨詢
QQ咨詢
服務熱線
服務熱線:13125520620
TOP

使用SQL*PLUS構建完美excel或html輸出-數據庫

發布時間:2011-11-12 瀏覽:5440

  本例通過簡單示例,介紹通過sql*plus輸出xls,html兩種格式文件.

  首先創建兩個腳本:
  1.main.sql
  用以設置環境,調用具體功能腳本

  2.功能腳本-get_tables.sql
  為實現具體功能之腳本

  通過這樣兩個腳本可以避免spool中的冗余信息.

  示例如下:
  1.main.sql腳本:


[oracle@jumper utl_file]$ more main.sql
set linesize 200
set term off verify off feedback off pagesize 999
set markup html on entmap ON spool on preformat off
spool tables.xls
@get_tables.sql
spool off
exit


  2.get_tables.sql腳本:


[oracle@jumper utl_file]$ more get_tables.sql
select owner,table_name,tablespace_name,blocks,last_analyzed
from all_tables order by 1,2;


  3.執行并獲得輸出:


[oracle@jumper utl_file]$ sqlplus "/ as sysdba" @main

SQL*Plus: Release 9.2.0.4.0 - Production on Mon Apr 25 10:30:11 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
[oracle@jumper utl_file]$ ls -l tables.xls
-rw-r--r-- 1 oracle dba 69539 Apr 25 10:30 tables.xls
[oracle@jumper utl_file]$

TAG
軟件定制,軟件開發,瀚森HANSEN,遼寧,沈陽,撫順
0
該內容對我有幫助