If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Fetching the blob data for a dynamic SQL in DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-04-04, 06:03
deepakg76 deepakg76 is offline
Registered User
 
Join Date: Oct 2003
Posts: 4
Fetching the blob data for a dynamic SQL in DB2

I am using IBM DB2 7.2 and 8.1 version on windows platform. My application fetch the blob/clob data from the database using following statement:
EXEC SQL FETCH Cursor0 USING DESCRIPTOR :*pstr;

The problem using above statement is that , I need to pass the buffer of size equal to the length of field configured at database. Suppose, I have configured a blob or clob field of table as 2GB. But I stored data of size 2KB. To fetch the data, I currently allocate the buffer pstr of size 2GB.

My problem is how to get the length of exact data in the field before passing a buffer to pstr.

In oracle, we get the blob data using following statement
EXEC SQL LOB DESCRIBE :a_clob GET LENGTH INTO :col_len;
EXEC SQL LOB READ :len
FROM :a_clob AT ff
INTO :sr_buff2 WITH LENGTH :len;

Or any other way to retrieve the blob/clob data is highly appreciable.

Thanks in Advance,
Deepak Kumar
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On