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

查看:43
本文介绍了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输出2.csvout3.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,因此在您的版本中可能有更好的方法甲骨文.

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天全站免登陆