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 -> Piecewise fetch on multiple columns

Piecewise fetch on multiple columns

From: <bwv1034_at_my-deja.com>
Date: Wed, 08 Sep 1999 00:02:31 GMT
Message-ID: <7r492g$cr2$1@nnrp1.deja.com>


Hi,

I have a question about handling multiple LONG columns in piecewise fetch/insert in Oracle7 OCI (using ogetpi/osetpi).

First, the issue of multiple LONG values in Oracle. Normally Oracle allows only a single LONG column per table, so handling multiple columns is not an issue. However, it is perfectly legal to create a view that, for example, gets two LONG columns from two different tables. When doing a select against such a view it is reasonable to get both LONG columns.

Second, the piecewise fetch. Oracle 7.3 makes available a number of “new piecewise” operations that offer improved performance on LONG columns. These operations are ODEFINPS, OGETPI and OSETPI. While these operations greatly improve OCI performance for LONG datatypes, they must be called in a precise order with respect to each other and to the other operations (OEXEC and OFETCH). I am trying to figure out how to use these piecewise operations in queries that return multiple LONG columns. The calling sequence for the OCI piecewise operations on LONG columns is driven by the status codes returned by repeated calls to OFETCH. Return code of ORA-03130 indicates that a buffer for the next chunk of data is needed, zero indicates that the fetch is complete. There is no code indicating the end of one LONG value and the beginning of the next. Once I am done fetching the contents of the first LONG column, I am trying to get the contents of the second column. If I call OFETCH again, my program GPFs. If I do not call OFETCH the result is the same failure.

There does not seem to be a way of guessing what needs to be done here. Oracle manuals only talk about a single LONG column case. I would appreciate it greatly if someone would share their experience in dealing with this issue.

Thanks,
-Misha Davidson
mbd_at_silverstream.com_NOSPAM

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Tue Sep 07 1999 - 19:02:31 CDT

Original text of this message

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