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: OCI: How to insert BLOB?

Re: OCI: How to insert BLOB?

From: Amit <jindal_at_roguewave.com>
Date: Fri, 5 Sep 2003 11:04:33 -0600
Message-ID: <bjaj1u$7m5$1@tux.cvo.roguewave.com>


> Do you have any more details on why it is not a recommended to use
> returning and who is saying so.

This was recommended by Oracle Technical support and engineers. I don't have the TAR number handy as it was about 1.5 years ago.

> Could this not happen using the code you posted earlier to this thread. It
seams
> you create a temporary lob, insert it and then write to the lob. These two
> approaches seem very similar to me.
> I would assume that this would all be neatly wrapped up in a transaction
in order
> to preserve integrity.

From my understanding (and I may be wrong here), the difference is the data is not updated in the table till you do a OCILobWrite. However I do find it confusing to understand.
What might be incorrect in the code I posted before is the order when OCILobWrite is called. Maybe its called before execute. If I get a chance, I will give it a try.



Amit Jindal, Development Engineer

Want ease of development or performance? Why not get both! http://www.roguewave.com/products/sourcepro/db/

[Disclaimer: All views expressed here are my personal views and they can be incorrect at times]


"stuart coupe" <stuart.coupe_at_easysoft.com> wrote in message news:bj9kc3$h33o9$1_at_ID-205574.news.uni-berlin.de...
> On Thu, 04 Sep 2003 13:30:21 +0000, Amit wrote:
>
> > Returning clause does works especially prior to Oracle 9. However
> > 'returning' SQL construct has some disadvantages and AFAIK it is not a
> > recommended choice for Oracle 9i onwards. For one, you cannot send data
> to
>
> Do you have any more details on why it is not a recommended to use
> returning and who is saying so.
>
> > a stored proc. You can with OCILobLocator. Further with returning clause
>
> Yes, but that wasnt the question ;)
>
> > you need to do two step execution. In that case, your table integrity is
> > not consistent because in first execution you have just inserted
> > EMPTY_CLOB which refers to a temporary buffer area. Suppose before you
> > have send the data, another thread tries to read the data?
>
> Could this not happen using the code you posted earlier to this thread. It
seams
> you create a temporary lob, insert it and then write to the lob. These two
> approaches seem very similar to me.
> I would assume that this would all be neatly wrapped up in a transaction
in order
> to preserve integrity.
>
> > This is not a problem with OCILobLocator.
> >
> > ----------------------------------------------------------------- Amit
> > Jindal, Development Engineer
> >
> >
> Cheers,
> Stuart.
Received on Fri Sep 05 2003 - 12:04:33 CDT

Original text of this message

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