Oracle如何将查询导出到文本/ csv文件 [英] Oracle how to export query to a text/csv file

查看:820
本文介绍了Oracle如何将查询导出到文本/ csv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何将查询从PL / SQL导出到文本文件或csv文件。我想到的查询导出大量的数据(约1 gig)。因此,我也希望将数据拆分到多个文件中;

I was wondering how to go about exporting a query from PL/SQL to an text file or csv file. The query I have in mind exports a huge amount of data (about 1 gig). So I'd also like the data split across multiple files;

out1.csv
out2.csv
out3.csv

out1.csv out2.csv out3.csv

我想要决定要拆分多少个文件。

I'd like to be able to decide how many files to split it across.

任何人都知道如何做?

推荐答案

使用 UTL_FILE

众所周知(可能是关于此主题的最完整的讨论)这可以在Ask Tom,找到在这里,请注意,许多示例可以追溯到oracle 8,所以在您的Oracle版本中可能有更好的方法。

A well known ( probably the most complete discussion on this topic ) discussion on this can be found at Ask Tom, Here , note that many of the examples there date back to oracle 8, so there may be better ways to do it in your version of Oracle.

这篇关于Oracle如何将查询导出到文本/ csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆