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中,如何为每个组选择前2行 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- SQL 临时表问题 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01