Intermedia oBJECTS

I have never tried this, but I can't imagine why it wouldn't work. I guess the answer would depend on what exactly you want to do. Perhaps others have any experience with this?

------------------
Marco Kalter
Allround Automations
 
Hi!

I'm trying to figure out the DOA code for accessing intermedia object (ORDImage)
I'm able to read the values from its member functions, but when I want to get hold on the BLOB, the size is 0.

10g doc:

CREATE OR REPLACE TYPE ORDImage
AS OBJECT
(
-------------------
-- TYPE ATTRIBUTES
-------------------
source ORDSource,
height INTEGER,
width INTEGER,
contentLength INTEGER,
fileFormat VARCHAR2(4000),
contentFormat VARCHAR2(4000),
compressionFormat VARCHAR2(4000),
mimeType VARCHAR2(4000),

procedure:

function get_thumbs return CursorType
as
res CursorType;
begin
open res for
select
t.id "ID",
t.thumb "THUMB"
from
imgtable t;
return res;
end;

code excerpt:

try
with OracleQuery1 do
begin
SQL.Clear;
SQL.Add('BEGIN :RESULT := VCP_IMAGE.GET_THUMBS; END;');
DeleteVariables;
DeclareVariable('RESULT', otCursor);
SetComplexVariable('RESULT', QueryCursor);
Execute;
with QueryCursor do
begin
Execute;
while not EOF do
begin
OraObj := ObjField('THUMB');
if not OraObj.IsNull then
begin
OraObj1 := OraObj.ObjAttr('SOURCE');
LOB := OraObj1.LOBAttr('LOCALDATA');
M.CopyFrom(LOB, LOB.Size); //size=0!?
end;
Next;
end;
end;
end;

Any ideas what can be wrong?

Bjarte
 
Any ideas what can be wrong?
May be the size is 0 for the same reason given in the topic "Passing object with object attributes to database by stored procedure".
May be it is impossible now to return data from object atrribute of any object from cursor or stored procedure or function so as in the example given in the topic above.
 
Back
Top