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 -> Fast access to a BLOB

Fast access to a BLOB

From: Matthias Späth <matthias.spaeth_at_optimum-gmbh.de>
Date: Fri, 9 Jul 1999 17:00:31 +0200
Message-ID: <7m52il$2m6t$1@news.karlsruhe.punkt.de>


Hi,

how can I tune the access to a BLOB. At this time I use this Pro*C/C++ Code: (this code needs about 1 second for a BLOB of less then 10k in a table of 3 columns (2 VARCHAR(256) and a BLOB) and about 10000 rows !!!)

EXEC SQL AT :conn ALLOCATE :blob;
EXEC SQL AT :conn SELECT data INTO :blob FROM archivtab WHERE objID=:obj;
EXEC SQL AT :conn LOB DESCRIBE :blob GET LENGTH INTO :length;
if (length == 0) return -1;
*ptr=malloc((unsigned int)length);
tmp=*ptr;

do
{
  amt=length>32000?32000:length;
  buffer.len=amt;

  EXEC SQL AT :conn LOB READ :amt FROM :blob AT :offset INTO :buffer;

  memmove(tmp,buffer.arr,amt);
  tmp+=32000;
  length-=32000;
  offset+=32000;
} while (length>0);

EXEC SQL AT :conn FREE :blob; Received on Fri Jul 09 1999 - 10:00:31 CDT

Original text of this message

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