Unix Technical Forum

passing CLOB in Stored Procedure as IN/OUT

This is a discussion on passing CLOB in Stored Procedure as IN/OUT within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi, I am trying to get an answer for 'Is it required to create a temporary lob before doing ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-23-2008, 11:52 AM
sachin.garge@gmail.com
 
Posts: n/a
Default passing CLOB in Stored Procedure as IN/OUT

Hi,

I am trying to get an answer for 'Is it required to create a temporary
lob before doing an in/out operation on a lob being passed as in/out
parameter in a stored-procedure?"

I have seen some of the OCI samples, wherein temporary lob is created
using OCILobCreateTemporary call and then we use OCILobWrite or
OCILobRead call but could not find a reason to do so.

I think it is logical to create a temporary lob for a table having
CLOB column rather for stored-procedure.

any suggestions will be helpful

Thanks,
Sachin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-24-2008, 10:32 PM
Vladimir M. Zakharychev
 
Posts: n/a
Default Re: passing CLOB in Stored Procedure as IN/OUT

On Jun 23, 12:22*pm, sachin.ga...@gmail.com wrote:
> Hi,
>
> I am trying to get an answer for 'Is it required to create a temporary
> lob before doing an in/out operation on a lob being passed as in/out
> parameter in a stored-procedure?"
>
> I have seen some of the OCI samples, wherein temporary lob is created
> using OCILobCreateTemporary call and then we use OCILobWrite or
> OCILobRead call but could not find a reason to do so.
>
> I think it is logical to create a temporary lob for a table having
> CLOB column rather for stored-procedure.
>
> any suggestions will be helpful
>
> Thanks,
> Sachin


No, it's not necessary to always create a temporary LOB: you can pass
a valid LOB locator pointing to some existing LOB in a table just the
same. For example, you can create a new row in a table with LOB column
defaulting to empty_{c|b}lob(), select it for update and then pass the
locator to your stored procedure (or just select existing LOB for
update.) The only requirement for LOB I/O is that the LOB locator
being read/written is valid (the LOB it points to exists it makes no
difference if the LOB is temporary or permanent.

Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com