In Oracle 11g, we are using XMLELEMENT to get records from tables. The problem seems to be, however, that we are calling SELECT XMLELEMENT(...).getClobVal() from DUAL; which is eating our temp tablespace like a sandwich.
I read that we can kill blob records using FREETEMPORARY(blob_ref), but in the format shown above, we have no reference to the blob. Is there any way to get one for it?
Because this is being run from a program and the library we use generates the PL/SQL block for us, it really cannot be restructured as a PL/SQL statement.
SELECTstatement in a PL/SQL block, you must by definition be selecting the result into some local variable. If you have no reference to the CLOB, that implies that you are issuing a SQL statement, not running a PL/SQL block, and that the calling application has a cursor handle for fetching the CLOB data that needs to be closed once you've fetched all the data. – Justin Cave Jan 9 '12 at 14:42