1、修改init.ora文件,设置utl_file_dir参数
如utl_file_dir='/ora01/test'
2、建立如下过程
create or replace procedure sp_test_write_file
(text_content in varchar2)
is
file_handle utl_file.file_type;
begin
--open file
file_handle:=utl_file.fopen(location=>'/ora01/test',filename=>'My_File.txt',open_mode=>'W');
--write file
utl_file.put_line(file_handle,text_content);
--close file
utl_file.fclose(file_handle);
exception
when others then
raise;
end sp_test_write_file;
需要先打开一个句柄,然后操作,最后关闭该句柄。
如utl_file_dir='/ora01/test'
2、建立如下过程
create or replace procedure sp_test_write_file
(text_content in varchar2)
is
file_handle utl_file.file_type;
begin
--open file
file_handle:=utl_file.fopen(location=>'/ora01/test',filename=>'My_File.txt',open_mode=>'W');
--write file
utl_file.put_line(file_handle,text_content);
--close file
utl_file.fclose(file_handle);
exception
when others then
raise;
end sp_test_write_file;
需要先打开一个句柄,然后操作,最后关闭该句柄。
解决方案 »
- 我这种情况,SGA设置合理吗?
- oracle 连接查询
- oracle11g 游标为什么不显示结果呢
- [高分]连接Oracle时,总是自动执行下面的语句:SELECT PARAMETER, VALUE FROM SYS.NLS_DATABASE_PARAMETERS ...
- sql优化的问题:(not)exists 比 (not)in 好吗?
- 字段中含有%的sql写法,请教:)
- 关于ORACLE数据库的迁移.
- 这个关于日期的SQL查询语句怎么样
- 这是8i版吗?这个版本怎么没有Create global temporary table 命令?
- 我有一个表,里面的某些记录的指定字段上含有‘%’,而某些记录的指定字段上含有‘_’,怎样用select like语句选出这些记录?
- 学Oracle要什么基础???
- oracle怎么获得进行数据库操作的应用程序名?
我自同一台服务器上,其他的两个数据库,可以用,唯独这个数据库不能用,
过程一样,配置也一样,oracle用户属性也一样,真是奇怪了