Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Please tell me what is wrong in my code or what i need to do ?

385609Jan 31 2003 — edited Jun 6 2003
I am getting the following error

PLS-00201: identifier 'DBMS_XMLQUERY.CTXTYPE' must be declared
PLS-00201: identifier 'DBMS_XMLQUERY.GETXML' must be declared


i am using oracle 8i

this is the code

create or replace package query_to_xml
as

procedure generate_xml;
procedure printClobOut(result IN OUT NOCOPY CLOB);

end query_to_xml;
/

create or replace package body query_to_xml
as

procedure generate_xml
is

queryCtx DBMS_XMLQUERY.ctxType;
result CLOB;
begin

-- set up the query context...!
queryCtx := DBMS_XMLQuery.newContext('select * from emp');

-- get the result..!
result := DBMS_XMLQuery.getXML(queryCtx);
-- Now you can use the result to put it in tables/send as messages..
printClobOut(result);
DBMS_XMLQuery.closeContext(queryCtx); -- you must close the query handle..
end generate_xml;


PROCEDURE printClobOut(result IN OUT NOCOPY CLOB) is
xmlstr varchar2(32767);
line varchar2(2000);
begin
xmlstr := dbms_lob.SUBSTR(result,32767);
loop
exit when xmlstr is null;
line := substr(xmlstr,1,instr(xmlstr,chr(10))-1);
dbms_output.put_line('| '||line);
xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
end loop;
end printClobOut;

end query_to_xml;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 4 2003
Added on Jan 31 2003
2 comments
696 views