• <small id='7pufl'></small><noframes id='7pufl'>

      <bdo id='7pufl'></bdo><ul id='7pufl'></ul>

      1. <legend id='7pufl'><style id='7pufl'><dir id='7pufl'><q id='7pufl'></q></dir></style></legend><tfoot id='7pufl'></tfoot>
      2. <i id='7pufl'><tr id='7pufl'><dt id='7pufl'><q id='7pufl'><span id='7pufl'><b id='7pufl'><form id='7pufl'><ins id='7pufl'></ins><ul id='7pufl'></ul><sub id='7pufl'></sub></form><legend id='7pufl'></legend><bdo id='7pufl'><pre id='7pufl'><center id='7pufl'></center></pre></bdo></b><th id='7pufl'></th></span></q></dt></tr></i><div id='7pufl'><tfoot id='7pufl'></tfoot><dl id='7pufl'><fieldset id='7pufl'></fieldset></dl></div>

        从 Oracle 数据库创建 Excel 电子表格

        时间:2023-09-18

        <tfoot id='p68Sz'></tfoot>

          <i id='p68Sz'><tr id='p68Sz'><dt id='p68Sz'><q id='p68Sz'><span id='p68Sz'><b id='p68Sz'><form id='p68Sz'><ins id='p68Sz'></ins><ul id='p68Sz'></ul><sub id='p68Sz'></sub></form><legend id='p68Sz'></legend><bdo id='p68Sz'><pre id='p68Sz'><center id='p68Sz'></center></pre></bdo></b><th id='p68Sz'></th></span></q></dt></tr></i><div id='p68Sz'><tfoot id='p68Sz'></tfoot><dl id='p68Sz'><fieldset id='p68Sz'></fieldset></dl></div>

            <small id='p68Sz'></small><noframes id='p68Sz'>

                <bdo id='p68Sz'></bdo><ul id='p68Sz'></ul>
                  <tbody id='p68Sz'></tbody>
                <legend id='p68Sz'><style id='p68Sz'><dir id='p68Sz'><q id='p68Sz'></q></dir></style></legend>
                • 本文介绍了从 Oracle 数据库创建 Excel 电子表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 Oracle 数据库中有一个表.我必须从 Oracle 表创建一个复杂的电子表格结构.我正在寻找实现这一目标的最佳方法.我可以使用 SSIS 或使用一些 Oracle 实用程序来创建电子表格吗.

                  I have a table in a Oracle database. I have to create a complex spreadsheet structure from the Oracle table. I am looking for best approach to achieve this. Can I use SSIS or use some Oracle utilities to create the spreadsheet.

                  任何帮助将不胜感激.

                  提前致谢.

                  问候迪布斯

                  推荐答案

                  我想问题是,你的复杂结构"到底有多复杂?

                  I suppose the problem is, just how complex is your "complex structure"?

                  Oracle SQL Developer 或 Quest TOAD 等编程 IDE 具有将数据表导出为 CSV 文件的向导.

                  Programming IDEs such as Oracle SQL Developer or Quest TOAD have wizards to export data table to CSV files.

                  如果要连接多个表中的数据,可以使用视图,甚至可以编写 SQL 语句

                  If you want to join data from multiple tables you could use a view, or even write a SQL statement

                  select e.ename||','||d.dname
                  from   emp e
                         join dept d on ( e.deptno = d.deptno )
                  /
                  

                  (记住列通常可以包含包含逗号的数据,因此您可能需要使用更不寻常的字符 - 或字符集 - 作为分隔符.)

                  (rembering that columns can often contain data which includes commas, so you may want to use a more unusual character - or set of characters - as your separator.)

                  另一种快速的方法是使用 SQL*Plus 的 HTML 报告功能.许多电子表格工具可以轻松导入结构良好的 HTML 和 XML.了解更多.

                  Another quick way of doing soemthing is to use SQL*Plus's HTML reporting function. Many spreadsheet tools can import well-structured HTML and XML without a snatch. Find out more.

                  如果您想要扁平化层次结构或更复杂的结构,您可能需要转向 PL/SQL.手动方法将使用适合使用 UTL_FILE 的上述语句的变体:

                  If you want to flatten a hierarchical structure or something even more convoluted you'll probably need to move into PL/SQL. A hand-rolled approach would use a variant of the above statement fitted to use UTL_FILE:

                  declare
                      csv_fh  utl_file.filetype;
                  begin
                      csv_fh := utl_file.fopen('C:	emp', 'data_export.csv', 'W');
                      for r in   (  select e.ename, d.dname
                                    from   emp e
                                    join dept d on ( e.deptno = d.deptno )
                                  ) loop
                          utl_file.put_line(csv_fh, r.ename||'|'||r.dname;
                      end loop;
                      utl_file.fclose(csv_fh);
                  end;
                  

                  如果您想专门导出到 Excel(即 .XLS 文件),那么您需要超越 Oracle 内置程序.直接从 PL/SQL 导出到 Excel 的常用解决方案是 Tom Kyte 的 SYLK api 的 OWA_SYLK 包装器.了解更多信息.

                  If you want to export specifically to Excel (i.e. a .XLS file) then you'll need to go beyond Oracle built-ins. The usual solution for exporting straight from PL/SQL to Excel is Tom Kyte's OWA_SYLK wrapper for the SYLK api. Find out more.

                  这适用于单个工作表.如果您想导出到多个工作表,有几种替代解决方案.

                  This works with single worksheets. If you want to export to multiple worksheets there are a couple of alternative solutions.

                  Sanjeev Sapre 有他的 get_xl_xml 包.顾名思义,它使用 XML 进行转换.了解更多.

                  Sanjeev Sapre has his get_xl_xml package. As the name suggests it uses XML to undertake the transformation. Find out more.

                  Jason Bennett 编写了一个生成 Excel XML 文档的 PL/SQL 对象.了解更多.

                  Jason Bennett has written a PL/SQL object which generates an Excel XML document. Find out more.

                  这篇关于从 Oracle 数据库创建 Excel 电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用两列透视数据 下一篇:如何处理 SELECT 语句中的 to_date 异常以忽略这些行?

                  相关文章

                  1. <i id='MDzAF'><tr id='MDzAF'><dt id='MDzAF'><q id='MDzAF'><span id='MDzAF'><b id='MDzAF'><form id='MDzAF'><ins id='MDzAF'></ins><ul id='MDzAF'></ul><sub id='MDzAF'></sub></form><legend id='MDzAF'></legend><bdo id='MDzAF'><pre id='MDzAF'><center id='MDzAF'></center></pre></bdo></b><th id='MDzAF'></th></span></q></dt></tr></i><div id='MDzAF'><tfoot id='MDzAF'></tfoot><dl id='MDzAF'><fieldset id='MDzAF'></fieldset></dl></div>
                      <bdo id='MDzAF'></bdo><ul id='MDzAF'></ul>

                    <small id='MDzAF'></small><noframes id='MDzAF'>

                    <legend id='MDzAF'><style id='MDzAF'><dir id='MDzAF'><q id='MDzAF'></q></dir></style></legend>
                    <tfoot id='MDzAF'></tfoot>