Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Using BLOBs in OCI

Re: Using BLOBs in OCI

From: John Hatcher <jhatcher_at_uk.oracle.com>
Date: Fri, 16 Jul 1999 10:40:57 +0100
Message-ID: <7mmujl$g8e$1@inet16.us.oracle.com>


Barak,

You must get your Lob Locator from the database before you can write to it.

The following code uses OCI++, but the principal is the same.

  // create table l (lob clob);
  COCITransaction t(s1);

  COCIStatement stmt(s1);
  COCICLob l(s1);
  l.make_empty();
  stmt = "insert into l values (:input) returning lob into :output";   stmt.bind(":input",l);
  stmt.bind(":output",l);
  if(stmt.execute())
  {
    l << "Hello " << "World";
  }

  t.commit();

OCI++ taken from:-

http://freespace.virgin.net/j.hatcher/ociwrap.htm

John.

BARAK wrote in message <37898f22.0_at_news.barak.net.il>...
>Hi,
>I have this problem:
>
>I'm using OCI combined with PRO C.
>
>I'm using "OCILobWrite" OCI function to put a BLOB data, but keep getting a
>(-2)
>return code. (BAD HANDLE).
>
>cc=OCILobWrite(oschp,errhp , ez_blob, &ez_len, (ub4) 0,
> (dvoid *)buf, (ub4) ez_len, OCI_ONE_PIECE,
> (dvoid *) 0,
> (sb4 (*)(dvoid *, CONST dvoid *, ub4 *, ub1 *)) 0,
> (ub2) 0, (ub1) SQLCS_IMPLICIT);
>
>There are 3 handle: oschp which is the service context.
> errhp is the error handle.
> ez_blob is the blob identifier.
>All three were allocated as shown in examples.
>
>can anyone help?
>
>Eyal.
>
>
>
Received on Fri Jul 16 1999 - 04:40:57 CDT

Original text of this message

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