Oracle to Excel - PL/SQL export procedure(Oracle 到 Excel - PL/SQL 导出程序)
问题描述
我正在编写将数据从 Oracle 导出到 Excel 的 pl/sql 过程.我需要数据格式,所以我不能使用 CSV.我已经尝试过使用 XML,但是当我想导出时它会生成太大的文件,例如70000 行 50 列(几乎 300 MB!!!).
I’m writing pl/sql procedure that exports data from Oracle to Excel. I need data formatting so I can’t use CSV. I’ve already tried with XML but it generates too large files when I want to export e.g. 70000 rows with 50 columns (almost 300 MB!!!).
这就是我决定使用 HTML 标签生成 XLS 文件的原因——它比 XML 小,我必须直接定义一些特殊列的格式(字符串、数字和日期由 Excel 自动格式化).非常简单方便,但我不能定义多个工作表.
That’s why I decided to use HTML tags to generate XLS file – it is smaller than XML and I must directly define format of only some special columns (strings, numbers and dates are formatted automatically by Excel). It’s very simple and convenient but I can’t define more than one worksheet.
您知道如何在使用 HTML 编写的 Excel 文件中添加/定义多个工作表吗?我试过使用像 <% ActiveWorkbook.Worksheet.Add %> 这样的 VBScript 公式,但它不起作用.
Do you know how to add/define more than one worksheet in excel file written using HTML? I’ve tried to use VBScript formula like <% ActiveWorkbook.Worksheet.Add %>, but it doesn’t work.
推荐答案
您可以通过 ODBC 或 OLEDB 将 Oracle 数据提取到现有 Excel 文档中,而不是在 Oracle 服务器上创建 Excel 或 HTML 文件.缺点是,你应该小心用户权限.
Instead of creating Excel or HTML files on Oracle server, you can fetch Oracle data to existing Excel document via ODBC or OLEDB. The shortcoming is, that you should be careful with user permissions.
https://www.youtube.com/watch?v=Adz0zZFePf8
这篇关于Oracle 到 Excel - PL/SQL 导出程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Oracle 到 Excel - PL/SQL 导出程序
基础教程推荐
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 在多列上分布任意行 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
