I am running into a scenario like when I am writing a XML file to a folder using PL/SQL it works, whereas when writing using stored procedure it fails and throwing an error as below
ORA-29289: directory access denied
ORA-06512: at "SYS.UTL_FILE", line 41
ORA-06512: at "SYS.UTL_FILE", line 478
ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 317
ORA-06512: at "TESTPROC", line 5
ORA-06512: at line 1
PL/SQL
declare
l_xmldoc clob;
begin
select XMLElement("dateval", sysdate).getClobVal() into l_xmldoc from dual;
dbms_xslprocessor.clob2file(l_xmldoc, 'XML_EDI_FILES', 'file1.xml', nls_charset_id('UTF8'));
end;
SP
create or replace procedure testproc is
l_xmldoc clob;
begin
select XMLElement("dateval", sysdate).getClobVal() into l_xmldoc from dual;
dbms_xslprocessor.clob2file(l_xmldoc, 'XML_EDI_FILES', 'file1.xml', nls_charset_id('UTF8'));
end;
I am sure that all the privileges are granted to the directory that I am writing to and that is why it works while using PL/SQL I believe.
Any help on this is much appreciated.
Thanks in Advance