17,088
社区成员
发帖
与我相关
我的任务
分享
create or replace procedure prc_orctoexcel IS
l_file utl_file.file_type;
a VARCHAR2(1024);
BEGIN
l_file :=utl_file.fopen('SJQYDIR','444.xls','w');
utl_file.put_line(l_file,'测试oracle数据导入excel');
utl_file.put(l_file,'111' || CHR(9));
utl_file.put(l_file,'222' || CHR(9));
utl_file.put(l_file,'333' || CHR(9));
utl_file.fclose(l_file);
l_file :=utl_file.fopen('SJQYDIR','444.xls','r');
utl_file.get_line(l_file,a);
dbms_output.put_line(a);
utl_file.fclose(l_file);
end prc_orctoexcel;
之前写的一个在oracle中向excel写数据的例子,希望对你有帮助。
'SJQYDIR'是提前定义好的dir。