Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Newbie OCI8 Piecewise fetch problem
I'm probably overlooking something really simple (or knowing me, an entire chapter
of a manual), but I've got to that stage where I feel like I'm bashing my head
against a brick wall and more information seems to be making less sense, not more.
I've set up a table containing a long column, populated it with some data. SQLPlus returns truncated data from the long column, so it's definately there in some form or another.
Now, I have no problem with prefetched data on select lists where longs aren't involved, it's where they are that problems occur.
The first odd thing is that the ATTR_DATA_SIZE returned for the long column is
zero.
That seems reasonable, considering how one wouldn't want to retrieve 2Gb of data in
every row... but that would imply that there would be a per-row method of finding
this out.. which seems at odds with the statement in the OCI8 manual 7-21 regarding
OCIDefineByPos that "At this point you do not need to specify the actual size of
the pieces that you will use, but you must provide the total size of the data that
will be fetched at run time". Presumably there's something documented somewhere
that I have overlooked.
No problem. I happen to know the amount of data for this test case, so the for the sake of experiementation I pass this to OCIDefineByPos with a NULL buffer. Return's OK, the fetch duly returns OCI_NEED_DATA. The OCIStmtGetPieceInfo however returns OCI_ONE_PIECE... OK, so again for the sake of experimentation I carry on, I give OCIStmtSetPieceInfo a buffer large enough and a piece spec of exactly the size of the data to be retrieved for the row, return OK. Now OCIStmtFetch returns OCI_NEED_DATA again, OCIGetPieceInfo returns OCI_ONE_PIECE again, OCIStmtSetPieceInfo returns OK and the OCIStmtFetch hangs (no SEGV, just hangs). Now sometime between the last fetch and this one, the contents of the variable I gave to the OCIStmtSetPieceInfo as the length of the retrieval (as a pointer) has been decremented.
As I say, I've probably done something really obtuse, or bypassed some important snippet of documentation, but ATM it feels like I'm trying to build a flat-pack wardrobe...
Any help much appreciated.
--
Tom Fosdick
tom (at) easysoft (dot) com
Don't be fooled by the fish!
Received on Fri Jul 23 1999 - 08:08:12 CDT
![]() |
![]() |