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

Home -> Community -> Usenet -> c.d.o.misc -> Re: LOB Support with Object Types?

Re: LOB Support with Object Types?

From: Michael Schaefers <schaefe3_at_cs.uni-bonn.spam-remove.de>
Date: Tue, 18 Jan 2005 10:04:58 +0100
Message-ID: <csijft$st2$1@f1node01.rhrz.uni-bonn.de>


DA Morgan wrote:

> Michael Schaefers wrote:
> 

>> I have problems accessing a BLOB within an object type (Oracle 10g on
>> a Linux machine).
>>
>> Consider a simple type
>>
>> CREATE TYPE foo AS OBJECT (
>> x int,
>> b BLOB,
>> ) NOT FINAL INSTANTIABLE;
>>
>> The BLOB has to be accessed within an external C routine. To achieve
>> this, I pass a foo object to a procedure similar to this:
>>
>> PROCEDURE bar (f OUT foo) IS EXTERNAL
>> LANGUAGE C [...]
>>
>> When I try to execute the following SQL-Statement I get an error when
>> opening the BLOB with OCILobOpen():
>>
>> DECALRE
>> f foo;
>> BEGIN
>> <packagename>.bar(f); *** C-Error is risen here
>> [...]
>> END;
>>
>> The error message says "ORA-22275: invalid LOB locator specified"
>>
>> One reason might be that, since my object f does not yet exist in any
>> table, the BLOB can not be accessed.
>>
>> Does anybody have a clue?
>> Regards,
>> Michael Schaefers
> 
> 
> Go to http://www.psoug.org
> click on Morgan's Library
> click on DBMS_LOB package
> look at the code examples: The page is not completed yet but hopefully 
> what is there will be somewhat helpful. Also look at
> http://asktom.oracle.com as Tom's examples will be complete.

Thanks for your helping answer. Indeed I have to use the DBMS_LOB.CREATETEMPORARY function to initialize the LOB variable.

Since I am within an external C routine, I used the OCILobCreateTemporary() function to do this. Now I can initialize, open, write into and close a LOB, but:

When the C function ends (without errors), Oracle throws an error "ORA-22621: error transfering an object from the agent". Unfortunately I can not find any information about this at all.

Regards, Michael Received on Tue Jan 18 2005 - 03:04:58 CST

Original text of this message

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