Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

BLOB versus CLOB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: BLOB versus CLOB
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

Senior Member


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

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

Start from here: http://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    Post subject: Reply to: BLOB versus CLOB
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: 1013
Location: India

PostPosted: Wed Aug 10, 2011 3:05 pm    Post subject:
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    Post subject: Reply to: BLOB versus CLOB
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: 1013
Location: India

PostPosted: Wed Aug 10, 2011 5:48 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Ccompar BLOB (images of type jpg) on ... nihad DB2 0 Sun Feb 05, 2017 3:13 pm
No new posts GETMAIN / FREEMAIN versus STORAGE OBT... steve-myers PL/I & Assembler 8 Wed Feb 01, 2017 1:45 am
No new posts Query using SUBSTRING on a column of ... sasanka DB2 5 Mon Jul 04, 2016 1:01 pm
No new posts Import bulk PDF or TXT files into BLO... satish.ms10 DB2 2 Tue Sep 15, 2015 4:51 pm
No new posts Fetching CLOB data suzeet COBOL Programming 2 Thu Jul 23, 2015 11:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us