Fast access to a BLOB
From: (wrong string) äth <matthias.spaeth_at_optimum-gmbh.de>
Date: Fri, 9 Jul 1999 17:00:31 +0200
Message-ID: <7m52il$2m6t$1_at_news.karlsruhe.punkt.de>
Hi,
*ptr=malloc((unsigned int)length);
tmp=*ptr;
Date: Fri, 9 Jul 1999 17:00:31 +0200
Message-ID: <7m52il$2m6t$1_at_news.karlsruhe.punkt.de>
Hi,
[Quoted] how can I tune the access to a BLOB. At this time I use this Pro*C/C++ Code: [Quoted] (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 - 17:00:31 CEST