Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Fetching a long in OCI
Hi,
I have a small question I hoped someone could help me with. I have a
table with a long (used to store an asciiz string), and I would like to
get the size of this field so that I can allocate the correct
amount of memory dynamically and fetch the data into this buffer in one
operation. I was hoping
that odescr would return the largest value (which, when only fetching
one row, would be the size of the field), however size was returned as
zero. So, what I want to do is something like this:
oparse(..., "select LONG from TABLE where ID=whatever");
odescr(..., &size, ...);
char *buffer = malloc(size);
odefin(..., buffer, size, ...);
oexfet(...);
I know that in 7.3 I can select this in chunks, but I would really prefer to get the whole thing in one piece :) Please reply with a Cc to sverre.hjelm_at_norway.eu.net.
Thanks,
Sverre Hjelm, EUnet Norway Received on Mon Nov 17 1997 - 00:00:00 CST