Hi,
I am trying to select data from the emp table and i want to display the data in XML format. I am having problems with the examples

*** stroing the result into another table temp_clon_tab as CLOB
*** How to extract the result from CLOB?

CREATE TABLE temp_clob_tab(result CLOB)

1 DECLARE
2 qryCtx DBMS_XMLGEN.ctxHandle;
3 result CLOB;
4 BEGIN
5 qryCtx := dbms_xmlgen.newContext
6 ('SELECT * from emp;');
7 DBMS_XMLGEN.setRowTag(qryCtx, 'EMPLOYEE');
8 DBMS_XMLGEN.setMaxRows(qryCtx, 5);
9 LOOP
10 result := DBMS_XMLGEN.getXML(qryCtx);
11 EXIT WHEN
12 DBMS_XMLGEN.getNumRowsProcessed(qryCtx)=0;
13 INSERT INTO temp_clob_tab VALUES(result);
14 END LOOP;
15* END;

I got the following error!

SQL> /
DECLARE
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-00911: invalid character



How can i print the XML format CLOB output, instead of inserting into table.


Many Thanks,