Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Using BLOBs in OCI
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
![]() |
![]() |