에서 xml 파일을 생성하면 저장 프로 시저가 실행될 때 오류가 발생합니다. 여기에 몇 가지 특수 문자 관련 문제는, 그래서 ORA-29285: file write error
가 ORA-31061: XDB error: special char to escaped char conversion failed
했다 당신이 이전에 언급 된 같은 문자 변환 오류가 아닌 여기에 XML 파일, generate XML from oracle tables오라클 테이블
Connecting to the database DB_old.
ORA-29285: file write error
ORA-06512: at "SYS.UTL_FILE", line 148
ORA-06512: at "SYS.UTL_FILE", line 889
ORA-06512: at "DBO_17FEB.EXPOR1", line 60
ORA-06512: at line 6
Process exited.
Disconnecting from the database DB_old.
-------------------
create or replace
PROCEDURE Expor1
(
V_TABLE_NAME IN varchar2
)
AS
BEGIN
----- Export table data
DECLARE
v_file UTL_FILE.file_type;
qryCtx DBMS_XMLGEN.ctxHandle;
result CLOB;
result1 CLOB;
v_FILENAME varchar2(30);
BEGIN
IF UPPER(V_TABLE_NAME) = 'PROJECT' THEN
qryCtx := dbms_xmlgen.newContext ('SELECT * from '||V_TABLE_NAME ||'');
ELSIF UPPER(V_TABLE_NAME) = 'LOGFILE' THEN
qryCtx := dbms_xmlgen.newContext ('select LOG_ID, USER_ID,RUN_DATE,PROCESS,MPOID,MODE_,trim(STATUS) as STATUS,
trim(regexp_replace(unistr(NOTES), ''[[:punct:]] '','''')) as NOTES,
MARKDELETED from logfile where rownum<100 ');
ELSE
qryCtx := dbms_xmlgen.newContext ('SELECT * from '||V_TABLE_NAME ||'');
END IF;
v_FILENAME :=V_TABLE_NAME;
DBMS_XMLGEN.setMaxRows(qryCtx, 5);
v_file := UTL_FILE.fopen('MYXML', v_FILENAME || '.xml', 'W');
UTL_FILE.put_line(v_file, '<XML><'||v_FILENAME||'></'||v_FILENAME||'> <RECORDS>');
-- v_file := UTL_FILE.FOPEN('MYXML', v_FILENAME|| '.xml', 'R');
LOOP
DBMS_XMLGEN.SETNULLHANDLING(qryCtx ,null);
DBMS_XMLGEN.setRowSetTag(qryCtx, 0);
DBMS_XMLGEN.setRowTag(qryCtx, 'RECORD');
-- save the XML into the CLOB field
result := DBMS_XMLGEN.getXML(qryCtx);
--result := REPLACE(result, '<?xml version="1.0"?>','<XML><'||v_FILENAME||'>'||result1 ||'</'||v_FILENAME||'>');
result := REPLACE(result, '<?xml version="1.0"?>',' ');
result := REPLACE(result, '<_x0030_>',' ');
result := REPLACE(result, '</_x0030_>',' ');
--result :=trim(result);
-- UTL_FILE.put_line(v_file, '');
EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
-- store the XML to a XML files
UTL_FILE.put_line(v_file, result);
--UTL_FILE.put_line(v_file, '</XML>');
END LOOP;
UTL_FILE.put_line(v_file, '</RECORDS></XML>');
UTL_FILE.FCLOSE(v_file);
END;
END Expor1;
i am not able to handle some special char like : &/; :/ . etc please help
표시된 오류는 현재 가지고있는 문제와 일치하지 않습니다. 나는 당신이 실제로'LOGFILE'을 호출 할 때 ORA-31061을 얻고 있다고 가정합니까? –