Oracle写入文件 [英] Oracle write to file

查看:126
本文介绍了Oracle写入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行oracle并有一个查询,该查询从数据库中提取了一些结果.我想将结果写为文本文件.我将如何去做?

I am running oracle and have a query which pulls some results from the database. I would like to write the results as a text file. How would I go about doing this?

我首选的方式是使用UTL_FILE.会有人举个例子吗?

My prefered way would be by using UTL_FILE. Would some one have an example of how to do this?

推荐答案

如果使用的是PL/SQL,则可以使用UTL_FILE程序包,与使用sql +后台打印程序不同的是,文件已写入服务器文件系统. UTL_FILE有很多限制,因此服务器端的另一种选择是使用Java存储过程.

If you are using PL/SQL then you can use the UTL_FILE package, the difference from using sql+ spool is that the files are written to the server file system. UTL_FILE has a number of limitations so an alternative on the server side would be to use Java stored procedures.

这篇关于Oracle写入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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