PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Compile-Fehler in Oracle Prozedur



Stefan2902
06-07-2009, 10:26
Hallo,

ich habe ein PL/SQL Skript geschrieben, welches mir den Inhalt einer Tabelle in einer XML Datei ausgibt.

Hier der Code:



DECLARE
qryCtx DBMS_XMLGEN.ctxHandle;
result CLOB;
BEGIN
qryCtx := dbms_xmlgen.newContext ('SELECT tran_num from ab_tran where rownum < 3');
DBMS_XMLGEN.setMaxRows(qryCtx, 5);
LOOP
-- save the XML into the CLOB field
result := DBMS_XMLGEN.getXML(qryCtx);
EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;

dbms_output.put_line(substr(result,1,255));

END LOOP;
END;


Ich möchte nun, eine Prozedur hieraus machen, um diese dann aus Java heraus aufzurufen. Leider compiliert die Oracle Prozedur nur mit Compilefehlern. Hier der Code für die Prozedur:



CREATE OR REPLACE procedure ENDUR11.recon_test(xml OUT CLOB)
IS
BEGIN
qryCtx DBMS_XMLGEN.ctxHandle;
qryCtx := dbms_xmlgen.newContext ('SELECT tran_num from endur11.ab_tran where rownum < 3');
DBMS_XMLGEN.setMaxRows(qryCtx, 5);
LOOP
-- save the XML into the CLOB field
result := DBMS_XMLGEN.getXML(qryCtx);
EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;

dbms_output.put_line(substr(result,1,255));

-- store the XML to a temporary table
--INSERT INTO temp_clob_tab VALUES(result);
END LOOP;
end recon_test;
/


Jemand eine Idee, wie ich die Prozedur richtig anlege?

Gruß
Stefan

mwanaheri
11-07-2009, 09:11
PL/SQL kenne ich nicht, aber in diesem Teil


CREATE OR REPLACE procedure ENDUR11.recon_test(xml OUT CLOB)
IS
BEGIN

hätte ich auf 'AS' statt 'IS' getippt