Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Using temp lobs in a function

Using temp lobs in a function

From: Rob George <rgeorge_at_emergisoft.com>
Date: Wed, 09 May 2001 04:34:38 GMT
Message-ID: <yN3K6.49021$2U.21100532@news2.rdc2.tx.home.com>

When I run this SQL I get and error "Invlaid CLOB" when more than one record is in the result set
I think it has to do with
DBMS_LOB.CreateTemporary(resfile,TRUE,DBMS_LOB.SESSION); ie the lob handle fro the session

What do I need to change to make this work?

SELECT SP_XSL_CLOB('H:\DISK55\XMLLOC', xmlclob,'xslfile') from the_table;

CREATE OR REPLACE FUNCTION SP_XSL_CLOB(dir varchar2, xmlfile clob,xslfile varchar2) RETURN CLOB is
p xmlparser.Parser;
xmldoc xmldom.DOMDocument;
xmldocnode xmldom.DOMNode;
proc xslprocessor.Processor;
ss xslprocessor.Stylesheet;
xsldoc xmldom.DOMDocument;
docfrag xmldom.DOMDocumentFragment;
docfragnode xmldom.DOMNode;
xslelem xmldom.DOMElement;
nspace varchar2(50);
xslcmds xmldom.DOMNodeList;
resfile clob;
resfile1 clob;
resfile2 clob;
resclob clob;

begin

   xslelem := xmldom.getDocumentElement(xsldoc);    nspace := xmldom.getNamespace(xslelem);

   xslcmds := xmldom.getChildrenByTagName(xslelem, '*', nspace);

   docfrag := xslprocessor.processXSL(proc, ss, xmldoc);    docfragnode := xmldom.makeNode(docfrag);    DBMS_LOB.CreateTemporary(resfile,TRUE,DBMS_LOB.SESSION);    xmldom.writeToClob(docfragnode,resfile);    return resfile;

when xmldom.INDEX_SIZE_ERR then

   raise_application_error(-20120, 'Index Size error');

when xmldom.DOMSTRING_SIZE_ERR then

   raise_application_error(-20120, 'String Size error');

when xmldom.HIERARCHY_REQUEST_ERR then

   raise_application_error(-20120, 'Hierarchy request error');

when xmldom.WRONG_DOCUMENT_ERR then

   raise_application_error(-20120, 'Wrong doc error');

when xmldom.INVALID_CHARACTER_ERR then

   raise_application_error(-20120, 'Invalid Char error');

when xmldom.NO_DATA_ALLOWED_ERR then

   raise_application_error(-20120, 'Nod data allowed error');

when xmldom.NO_MODIFICATION_ALLOWED_ERR then

   raise_application_error(-20120, 'No mod allowed error');

when xmldom.NOT_FOUND_ERR then

   raise_application_error(-20120, 'Not found error');

when xmldom.NOT_SUPPORTED_ERR then

   raise_application_error(-20120, 'Not supported error');

when xmldom.INUSE_ATTRIBUTE_ERR then

   raise_application_error(-20120, 'In use attr error');

end sp_xsl_clob; Received on Tue May 08 2001 - 23:34:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US