IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

BLOB versus CLOB


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shweta bansal5

New User


Joined: 02 Aug 2011
Posts: 10
Location: India

PostPosted: Tue Aug 09, 2011 3:14 pm
Reply with quote

Hi

In my application, earlier we were dumping 32K bytes of data into a Varchar column.
Now the size of data has increase upto 600K. The column type has been changed to BLOB. Can someone tell me what is the difference between BLOB and CLOB. And why BLOB was preferred over CLOB. Is it something related to the limits or storage space?

Thanks,
Shweta
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Aug 09, 2011 3:45 pm
Reply with quote

Start from here: www.ibmsystemsmag.com/ibmi/developer/general/BLOBs,-CLOBs-and-RPG/
Back to top
View user's profile Send private message
shweta bansal5

New User


Joined: 02 Aug 2011
Posts: 10
Location: India

PostPosted: Wed Aug 10, 2011 11:21 am
Reply with quote

Thanks for the reply, Anuj.

I read the document. Its a good information about CLOB and BLOB. But my question is why did we prefer BLOB to CLOB. And the data to be dumped in the column is actually character data. So we could use CLOB as well.
Do you know if BLOB takes some less storage or there is some other advantage over CLOB.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Wed Aug 10, 2011 3:05 pm
Reply with quote

Hi Shweta,

Basically,
BLOB is used for storing binary objects, JPG, mp3's or AVI's.
CLOB is used for storing character large objects, very big XML sort of files.

Quote:
the data to be dumped in the column is actually character data. So we could use CLOB as well.
Yes, I agree, but need to talk with the DBA or someone in the team to know, Why ? they have decided to go that way.

Can you tell what data does the column is used to store.

Thanks,
Sushanth
Back to top
View user's profile Send private message
shweta bansal5

New User


Joined: 02 Aug 2011
Posts: 10
Location: India

PostPosted: Wed Aug 10, 2011 5:08 pm
Reply with quote

Hi Sushanth,

we are using that column for storing 600K bytes of data, which is defined in a copybook and can have numeric, characters and any comp fields.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Wed Aug 10, 2011 5:48 pm
Reply with quote

Hi Shweta,

Internally, CLOB is varying-character string and BLOB is a varying-binary string.

The benefit of storing it in a CLOB, you can query(SELECT) the data and see what's inside it, if required for any purposes and when stored in a BLOB, i don't think you can read it so easily, since its considered as a binary.

Also, i don't think there will be any storage differences of storing the same data in CLOB and BLOB.

Note:-
I cannot confirm the statement about selecting BLOB data, since i don't have any BLOB columns with data.


Thanks,
Sushanth
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Storing a BLOB/CLOB in PL/I PL/I & Assembler 4
No new posts CLOB Column data to External File usi... DB2 9
No new posts FILE versus DATASET All Other Mainframe Topics 9
No new posts Ccompar BLOB (images of type jpg) on ... DB2 0
Search our Forums:

Back to Top