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: DA Morgan <damorgan_at_x.washington.edu>
Date: Tue, 18 Jan 2005 08:49:41 -0800
Message-ID: <41ed3e1b$1_1@127.0.0.1>


Michael Schaefers wrote:

> 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

Can't help you there but hopefully someone else can. My advice is always to not do such things in a front-end where debugging and tuning are either difficult or impossible. Better to write a proc or function in a package and use it as an API.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Received on Tue Jan 18 2005 - 10:49:41 CST

Original text of this message

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