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