我正在尝试写入存储在名为 vin1.txt 的 c:\ 驱动器中的文件并收到此错误。请建议!
> ERROR at line 1: ORA-29280: invalid
> directory path ORA-06512: at
> "SYS.UTL_FILE", line 18 ORA-06512: at
> "SYS.UTL_FILE", line 424 ORA-06512: at
> "SCOTT.SAL_STATUS", line 12 ORA-06512:
> at line 1
这是代码
create or replace procedure sal_status
(
p_file_dir IN varchar2,
p_filename IN varchar2)
IS
v_filehandle utl_file.file_type;
cursor emp Is
select * from employees
order by department_id;
v_dep_no departments.department_id%TYPE;
begin
v_filehandle :=utl_file.fopen(p_file_dir,p_filename,'w');--Opening a file
utl_file.putf(v_filehandle,'SALARY REPORT :GENERATED ON %s\n',SYSDATE);
utl_file.new_line(v_filehandle);
for v_emp_rec IN emp LOOP
v_dep_no :=v_emp_rec.department_id;
utl_file.putf(v_filehandle,'employee %s earns:s\n',v_emp_rec.last_name,v_emp_rec.salary);
end loop;
utl_file.put_line(v_filehandle,'***END OF REPORT***');
UTL_FILE.fclose(v_filehandle);
end sal_status;
execute sal_status('C:\','vin1.txt');--Executing