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 -> OCILobRead

OCILobRead

From: Iain William Wiseman <bibble_at_paradise.net.nz>
Date: Mon, 21 Aug 2006 19:17:36 +1200
Message-ID: <44e95e0c$1@clear.net.nz>


Hi,

I currently read data using arrays and for Long Raws I use Piecewise operation with OCISetPieceInfo etc...

I have recently looked into OCILobRead and OCILobWrite. Is it possible to read arrays of lobs using these operations.

Here what I do at the moment for a single row roughly

  OCIStmtPrepare(stmthp,

                 errhp,
                 sqlstmt,

(ub4)strlen((char *)sqlstmt),
(ub4)OCI_NTV_SYNTAX,
(ub4)OCI_DEFAULT));
OCIDefineByPos(stmthp, &defnp1, errhp,
(ub4) 1,
(dvoid *)&lobl,
(sb4)0,
(ub2) SQLT_CLOB,
(dvoid *) 0,
(ub2 *) 0,
(ub2 *) 0,
(ub4) OCI_DEFAULT);
OCIStmtExecute(svchp, stmthp, errhp,
(ub4) 1,
(ub4) 0,
(CONST OCISnapshot*) 0,
(OCISnapshot*) 0,
(ub4) OCI_DEFAULT);
retval = OCILobRead(svchp, errhp, lobl, &amtp, offset, (dvoid *) bufp, (ub4) MAXBUFLEN, (dvoid *)0, (sb4 (*)(dvoid *, const dvoid *, ub4, ub1)) 0, (ub2) 0, (ub1) SQLCS_IMPLICIT);

I have a few questions,

  1. Can I now make lobl an index to do arrays. e.g.

OCILobLocator* lobl[numberOfRows]

then

  retval = OCILobRead(svchp,

                      errhp,
                      lobl[i],
                      &amtp,
                      offset,
                      (dvoid *) bufp,
                      (ub4) MAXBUFLEN, (dvoid *)0,
                      (sb4 (*)(dvoid *, const dvoid *, ub4, ub1)) 0,
                      (ub2) 0,
                      (ub1) SQLCS_IMPLICIT);

2) If I have an number and a clob can I do a Fetch before reading the Lob.

3) What is the exact syntax for the define with an array of OCILobLocators.

4) Any advice. Note I do not want to use and array of structs as I do not know the structure. For all other types other than large objects I dynamics allocate the memory require and pass a pointer to it.

Thanks All,
Iain Received on Mon Aug 21 2006 - 02:17:36 CDT

Original text of this message

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