PL/SQL error receieved on making of an XML file

S0OO0

New Member
I am trying to make an XML file using PL/SQL procedure by using the following code:-\[code\]create or replace directory temp_dir as 'C:\XML';grant read, write on directory temp_dir to hr;DECLARE doc DBMS_XMLDOM.DOMDocument; xdata XMLTYPE; CURSOR xmlcur IS SELECT xmlelement("Employee",XMLAttributes('http://www.w3.org/2001/XMLSchema' AS "xmlns:xsi", 'http://www.oracle.com/Employee.xsd' AS "xsi:nonamespaceSchemaLocation") ,xmlelement("EmployeeNumber",e.employee_id) ,xmlelement("EmployeeName",e.first_name) ,xmlelement("Department",xmlelement("DepartmentName",d.department_name) ,xmlelement("Location",d.location_id) ) ) FROM employees e ,departments d WHERE e.department_id=d.department_id; BEGIN OPEN xmlcur; FETCH xmlcur INTO xdata; CLOSE xmlcur; doc := DBMS_XMLDOM.NewDOMDocument(xdata); DBMS_XMLDOM.WRITETOFILE(doc, 'temp_dir/myXML1.xml'); EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20002,'Error writing out XML.'); END;\[/code\]but i am recieving following error:-\[code\]Line 185: ORA-29280: invalid directory pathORA-06512: at "SYS.UTL_FILE", line 41ORA-06512: at "SYS.UTL_FILE", line 478ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 217ORA-29280: invalid directory pathORA-29280: invalid directory pathORA-06512: at "XDB.DBMS_XMLDOM", line 5292ORA-06512: at line 23\[/code\]what i am doing wrong.
 
Back
Top