What are Lob Data Types? What are the restrictions on these datatypes in JDBC?


A BLOB is binary large object that can hold a variable amount of data with a maximum length of 65535 characters

These are used to store large amounts of binary data, such as images or other types of files.

A CLOB stands for Character Large Object in general, an SQL Clob is a built-in datatype is used to store large amount of textual data. Using this datatype, you can store data up to 2,147,483,647 characters.

Blob and Clob data types together are known as LOB (Large Object) datatypes. Following are the restrictions on these datatypes.

  • Cannot compare: We cannot compare CLOB or BLOB datatypes i.e. you cannot use these datatypes with the operators =, !=.

  • Not Orderable: You cannot arrange BLOB or CLOB datatypes in order i.e. you cannot determine which is greater smaller among two BLOB or CLOB datatypes. In short cannot use <, <=, >, >= with BLOB or CLOB types.

  • These cannot be used as primary key or index values

  • Using clauses like DISTINCT, GROUP BY, and ORDER BY with BLOB or CLOB datatypes is not allowed.

  • Implicit conversion BLOB or CLOB to other datatypes is not possible.

Updated on: 30-Jul-2019

142 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements