暂无图片
暂无图片
暂无图片
暂无图片
1
暂无图片

格式化输出Oracle中的数据

原创 宋化鑫 2020-02-24
739

生成 html 文件

1、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 /u01/tables.html @/u01/get_tables.sql spool off exit
复制

2、get_tables.sql – 功能脚本,实现具体功能的脚本,通过这两个脚本可以避免 spool 中的冗余信息。

select owner,table_name,tablespace_name,blocks,last_analyzed from all_tables order by 1,2;
复制

3、执行并获得输出
sqlplus -S “/ as sysdba" @/u01/main.sql

生成 xls 文件

1、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 /u01/tables.xls @/u01/get_tables.sql spool off exit
复制

2、get_tables.sql – 功能脚本,实现具体功能的脚本,通过这两个脚本可以避免 spool 中的冗余信息。

select owner,table_name,tablespace_name,blocks,last_analyzed from all_tables order by 1,2;
复制

3、执行并获得输出
sqlplus -S “/ as sysdba" @/u01/main.sql

生成 css 文件

set linesize 200 set pagesize 999 set term off verify off feedback off heading off trims on set markup csv on spool /u01/tables.csv select * from scott.emp; spool off exit
复制
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
1人已赞赏
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

章芋文
暂无图片
5年前
评论
暂无图片 0
好文,点赞👍
5年前
暂无图片 点赞
评论