DBD-Informix
view release on metacpan or search on metacpan
ifx_int8_t size;
/* JL 2005-07-27: bloblen is a hack for 64-bit platforms */
/* ifx_int8tolong() takes an Informix int4* and not a long*! */
int4 bloblen;
EXEC SQL GET DESCRIPTOR :nm_obind VALUE :index
:bclob = DATA;
LO_fd = ifx_lo_open(&bclob, LO_RDONLY, &error);
if (LO_fd == -1)
croak("Error opening %cLOB: %d", cb, error);
if (ifx_lo_stat(LO_fd, &LO_stat) < 0)
croak("Error getting %cLOB stat", cb);
if (ifx_lo_stat_size(LO_stat, &size) != 0)
croak("Error getting %cLOB size", cb);
if (ifx_int8tolong(&size, &bloblen) != 0)
croak("Error converting %cLOB size to length", cb);
length = bloblen;
if (ifx_lo_close(LO_fd) != 0)
croak("Error closing %cLOB", cb);
if (ifx_lo_to_buffer(&bclob, length, &result, &error) < 0)
croak("Error copying from %cLOB", cb);
( run in 0.449 second using v1.01-cache-2.11-cpan-49f99fa48dc )