First time asking a question here, so please forgive any newbie trip-ups.
I'm attempting to get the properties of a document saved as a blob in my oracle database using orddoc.getProperties, but keep coming up against a rather unhelpful user-defined exception.
One of my co-workers has gotten ordimage.getProperties working reliably on the same database, but nothing I've tried seems to resolve the problem for documents.
For certainty, I ran the exact code example from Oracle Base to ensure that I'm calling everything correctly (see below).
Can someone please clarify what's going on here and hopefully offer a suggestion on what I could do to correct it?
SETUP:
CREATE TABLE tdoc(n NUMBER,
document BLOB,
attributes CLOB,
mimetype VARCHAR2(80),
format VARCHAR2(80),
contentlength INTEGER)
LOB(document) STORE AS SECUREFILE;
INSERT INTO tdoc VALUES(1, EMPTY_BLOB(), EMPTY_CLOB(), NULL, NULL, NULL);
INSERT INTO tdoc VALUES(2, EMPTY_BLOB(), EMPTY_CLOB(), NULL, NULL, NULL);
INSERT INTO tdoc VALUES(3, EMPTY_BLOB(), EMPTY_CLOB(), NULL, NULL, NULL);
INSERT INTO tdoc VALUES(4, EMPTY_BLOB(), EMPTY_CLOB(), NULL, NULL, NULL);
COMMIT;
TEST SCRIPT:
DECLARE
doc_attrib CLOB;
ctx RAW(64) :=NULL;
doc_data BLOB;
doc_format VARCHAR2(160) := NULL;
BEGIN
SELECT document,attributes INTO doc_data,doc_attrib FROM tdoc WHERE N = 1 FOR UPDATE;
ORDSYS.ORDDoc.getProperties(ctx, doc_data, doc_attrib, doc_format);
DBMS_OUTPUT.put_line('Size of XML Annotations ' ||
TO_CHAR(DBMS_LOB.GETLENGTH(doc_attrib)));
UPDATE tdoc SET document=doc_data, attributes=doc_attrib WHERE N=1;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
/
OUTPUT:
DECLARE
*
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "ORDSYS.ORDDOC", line 486
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at line 17
No errors.