如何在 Toad for Data Analyst 中将结果导出到 Excel 的不同选项卡?

How to export the result into different tabs of Excel in Toad for Data Analyst?(如何在 Toad for Data Analyst 中将结果导出到 Excel 的不同选项卡?)
本文介绍了如何在 Toad for Data Analyst 中将结果导出到 Excel 的不同选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何使用数据分析师在 TOAD 中的报表自动化将多个查询的结果导出到同一个 Excel 工作簿的不同工作表中?谢谢

Does anyone know how to export results from more than one query into different sheets of the same Excel workbook using the report automation in TOAD for data analyst? Thank you

推荐答案

我不确定您是否可以使用 Toad 自动执行此操作,但是您可以使用 Excel 执行一个小技巧.

I'm not sure that you can do that with Toad automatically but there is a little trick that you can do with Excel.

编写第一个查询并在Toad中执行,然后右键单击查询结果数据网格并选择导出数据集...",在Excel格式下选择Excel实例"并单击确定".它将打开 Excel 并添加一张包含查询数据的工作表.

Write first query and execute it in Toad, after that right click on query result data grid and choose "Export dataset...", under Excel format choose "Excel instance" and click OK. It will open Excel and add one sheet with data from your query.

对第二个查询重复相同的过程,它会将另一个工作表添加到同一文档并填充第二个查询的数据.

Repeat same process for second query and it will add another sheet to same document and fill with data from second query.

执行完所有查询并将其添加到 Excel 后,保存 excel 文档.

After you executed all queries and added it to Excel save excel document.

如果您想完全自动执行此操作,您可以使用另一种解决方案来创建包含多个工作表的单个 Excel 文档,这些工作表加载了来自不同查询的数据.购买第三方 PL/SQL 包 ORA_EXCEL.

If you want to do that completely automatically, there is another solution which you can use to create single Excel document with multiple sheets which are loaded with data from different queries. Purchase the third party PL/SQL package, ORA_EXCEL.

这是如何做到这一点的示例:

Here is example how to do that:

BEGIN  
    ORA_EXCEL.new_document;  

    ORA_EXCEL.add_sheet('Employees');  
    ORA_EXCEL.query_to_sheet('select * from employees');  

    ORA_EXCEL.add_sheet('Departments');  
    ORA_EXCEL.query_to_sheet('select * from departments', FALSE);  

    ORA_EXCEL.add_sheet('Locations');  
    ORA_EXCEL.query_to_sheet('select * from locations');  

    -- EXPORT_DIR is an Oracle directory with at least  
    -- write permission  
    ORA_EXCEL.save_to_file('EXPORT_DIR', 'example.xlsx');  
END;

它可以生成 Excel 文件并将其存储到 Oracle 目录中,或者您可以将生成的 Excel 文件放入 PL/SQL BLOB 变量中,以便您可以将其存储到表中或创建自己的过程来分发文件,例如将其发送到电子邮件.

It can generate Excel file and store it to Oracle directory, or you can get generated Excel file into PL/SQL BLOB variable so you can store it to table or create your own process to distribute file like sending it to email.

您可以在产品文档/示例页面上找到更多详细信息:http://www.oraexcel.com/examples

More details you can find on products documentation/examples page: http://www.oraexcel.com/examples

干杯

这篇关于如何在 Toad for Data Analyst 中将结果导出到 Excel 的不同选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)
MyBatis support for multiple databases(MyBatis支持多个数据库)
Oracle 12c SQL: Missing column Headers in result(Oracle 12c SQL:结果中缺少列标题)
SQL query to find the number of customers who shopped for 3 consecutive days in month of January 2020(查询2020年1月连续购物3天的客户数量)
How to get top 10 data weekly (This week, Previous week, Last month, 2 months ago, 3 month ago)(如何每周获取前十大数据(本周、前一周、上个月、2个月前、3个月前))
Select the latest record for an Id per day - Oracle pl sql(选择每天ID的最新记录-Oracle pl SQL)