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

Home -> Community -> Usenet -> c.d.o.server -> setproperties on new ORDDOC gives ORA-6512?

setproperties on new ORDDOC gives ORA-6512?

From: AK <evantate_at_hotmail.com>
Date: 22 Oct 2003 22:38:00 -0700
Message-ID: <8b917913.0310222138.704367f3@posting.google.com>


Hello,

I posted this to the PL/SQL forum and was advised to repost it here.

I am attempting to convert the CLOBs in an existing table into ORDDOCs in a new table.

I _seemed_ to be almost there. I allocated a new ORDDOC using INIT(), and used writeToSource() on the doc pointer to transfer the text (which I first converted to RAW). The application that accepts this now lists the new document, and displays the text contents.

I now need to set the size (and MIME type, even though the app seems to understand that it's a text document). I called setproperties()after writeToSource, and get a set of ORA-6510/ORA-6512 errors (included below). I have tried all sorts of variations of openSource(), closeSource(), setMimeType() (which _does_ work) to no avail.

I'd really appreciate any advice! Alternatively, if there's a better way to do this, instead of using writeToSource() etc, please tell me. After this exercise, the app will have to be able to convert text submitted from an HTML form into new ORDDOCs, so I can't simply dump the CLOBs to Unix files and load them "properly".

I have also tried setproperties on a document that was loaded "conventionally" - that is, from an external file, which has had its properties (MIME type and content length) set correctly when uploaded. Running setproperties on this type of document still fails.

Thanx and regards,

Arn.

DEV1> l
1 DECLARE
2
3 srcRec arn5%ROWTYPE;
4 doc ORDSYS.ORDDOC;
5 ctx RAW(4000) :=NULL;
6 userArg RAW(4000);
7 len INTEGER;
8 comtxt VARCHAR2(32767);
9 comraw RAW(32767);
10 res integer;
11 doc2 ORDSYS.ORDDOC;
12
13 BEGIN
14
15 DELETE FROM assessment_document
16 WHERE DOC_NO = 0;
17
18 DELETE FROM media_document
19 WHERE DOC_NO = 0;
20
21 INSERT INTO assessment_document VALUES( 1, 0 ); 22
23 INSERT INTO media_document VALUES(
24 0, 'comment3.txt', 758197915, SYSDATE, 758197915, SYSDATE, 25 ORDSYS.ORDDOC.INIT()
26 ) RETURNING DOC_OBJ INTO doc;
27
28 SELECT *
29 INTO srcRec
30 FROM arn5
31 WHERE a=0;
32
33 len := LENGTH( srcRec.b );
34 --res:= doc.openSource(userArg, ctx); 35
36 comtxt := dbms_lob.substr(srcRec.b); 37 doc.writeToSource(ctx, 1, len, utl_raw.cast_to_raw(comtxt)); 38 doc.setProperties(ctx,true);
39
40 COMMIT;
41* END;
DEV1> /
DECLARE
*
ERROR at line 1:

ORA-06510: PL/SQL: unhandled user-defined exception 
ORA-06512: at "ORDSYS.ORDDOC", line 337 
ORA-06510: PL/SQL: unhandled user-defined exception 
ORA-06512: at line 38
Received on Thu Oct 23 2003 - 00:38:00 CDT

Original text of this message

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