Questions tagged [clob]

Character Large Object - SQL data type used to store character strings longer than the regular CHAR and VARCHAR types allow.

Character Large Object - SQL data type intended to store character strings longer than the regular CHAR and VARCHAR types handle.

See also NCLOB data type which is recommended for storing National Character strings/Unicode.

Oracle: CLOBs are stored externally and are referenced from table, so using them involves performance hit in comparison to using VARCHAR2. In exchange they have very high size limits, depending on exact version of RDBMS but not smaller than 2 GB.

Main difference between CLOB and BLOB data type is that CLOB has defined character encoding and to limited extent can be compared to strings, indexed and searched.

1067 questions
9
votes
3 answers

convert String to Clob and vice versa in Hibernate

Suppose that I have a Class: class EventTransaction { ..... private Clob dataXML; public Clob getDataXML() { return dataXML; } public void setDataXML(Clob dataXML) { this.dataXML = dataXML; } } And Hibernate…
hoang nguyen
  • 2,119
  • 5
  • 21
  • 20
9
votes
1 answer

Defining size of CLOB in Oracle

I am making a table in which I am storing XML. To store XML I am using CLOB data type. The max size of my XML would be 5kb. What size of CLOB column should I define while creating the table?
Femme Fatale
  • 870
  • 7
  • 27
  • 56
9
votes
1 answer

Do java.sql.Array/Blob/Clob types need to be "free()"ed?

Do I need an explicit to call free() on Arrays, clobs etc... or will closing the ResultSet and/or Statement automatically take care of this? The javadoc doesn't say anything, so I assume that it's not necessary, but I would hate to make an incorrect…
BillRobertson42
  • 12,602
  • 4
  • 40
  • 57
9
votes
9 answers

SQL - How do you compare a CLOB

in a DB2 trigger, I need to compare the value of a CLOB field. Something like: IF OLD_ROW.CLOB_FIELD != UPDATED_ROW.CLOB_FIELD but "!=" does not work for comparing CLOBs. What is the way to compare it? Edited to add: My trigger needs to do some…
Tipa Shel Or
  • 411
  • 1
  • 5
  • 11
8
votes
1 answer

Displaying CLOB Column with 4000+ characters

I have this CLOB column and I need to display it using a select statement. I used DBMS_LOB.SUBSTR to convert it to varchar2: select DBMS_LOB.SUBSTR(T1.CLOB_COL,4000,1) CLOB_COL from T1 My problem is some of my CLOBS contains more than 4000…
pein Asd
  • 81
  • 1
  • 1
  • 2
8
votes
2 answers

Entity Framework ORA-00932: inconsistent datatypes: “'expected CLOB got CHAR”

Oracle.ManagedDataAccess.EntityFramework 6.122.1.0 library is used to access to an Oracle Database from MVC ASP.Net application. It is the latest library version from the NuGet as of November, 14th 2017 protected override Expression
3per
  • 351
  • 9
  • 26
8
votes
3 answers

DBunit generates java.lang.ClassCastException: java.lang.String cannot be cast to oracle.sql.CLOB when trying to load a CLOB field

I am using the latest version of DBUnit (2.4.7), on Oracle 11GR2. I'm using Java 6 (1.6.0_15) and the latest version of Oracle's client jar (jdbc6.jar) I've been unable to successfully load any data referenced by a CLOB Oracle field from an XML file…
Paul
  • 161
  • 2
  • 4
8
votes
2 answers

SQL Server 2012 getClob() : The conversion from varchar (nvarchar) to CLOB is unsupported

I wonder what am I doing wrong in the scenario described below. I assessing some SQL Server versions for a project, and playing around with different DB types in a simple Java setting. I use Eclipse, Java 6 (1.6u45), driver sqljdbc4.jar, Sql Server…
ioni28
  • 81
  • 1
  • 4
8
votes
0 answers

Creating CLOB in OCCI for inserting into database

I have some large data objects that have been serialized into a string/ostringstream using Boost. I would like to store these serialized objects in the database with the datatype CLOB via a procedure. In order to do so I am creating a CLOB-object…
Svend Andreasen
  • 173
  • 1
  • 8
8
votes
1 answer

java.lang.AbstractMethodError: oracle.jdbc.driver.T4CPreparedStatement.setCharacterStream(ILjava/io/Reader;J)V

I'm getting the following exception when trying to insert the contents of a CKEditor (for CMS - Contents Management System) into Oracle database - Oracle 10g. The field in the Oracle table is of type clob. java.lang.AbstractMethodError: …
Tiny
  • 27,221
  • 105
  • 339
  • 599
7
votes
2 answers

What is a temporary CLOB in buffer cache for?

The dbms_lob.createtemporary function takes three parameters, one of which specifies if the temporary LOB is to be "read into buffer cache or not". I'm not entirely clear on what that means. More importantly, when do i want my LOB in the buffer…
eaolson
  • 14,717
  • 7
  • 43
  • 58
7
votes
2 answers

Postgres UTF-8 clobs with JDBC

Postgres JDBC driver seems to not handle UTF-8 clobs correctly. When you retrieve the clob the characters are not correct (you get ? marks for non ascii characters). Supposedly this is a known…
Adam Gent
  • 47,843
  • 23
  • 153
  • 203
7
votes
4 answers

How can I update data in CLOB fields using a >> prepared query << with ODP (Oracle.DataAccess)?

I'm trying to execute a prepared sql query which updates CLOB fields in an Oracle 10g database (10.2.0.1). If I execute the following query from inside SQL Developer and supply the values for the placeholders, there is no prblem. If I however…
Tim Meyer
  • 12,210
  • 8
  • 64
  • 97
7
votes
3 answers

Converting from String to Clob using setString() not working

I am trying to convert a String into a Clob to store in a database. I have the following code: Clob clob = connection.createClob(); System.out.println("clob before setting: " + clob); clob.setString(1,"Test string" ); System.out.println("clob after…
Bugalugs Nash
  • 492
  • 1
  • 6
  • 21
7
votes
2 answers

Extract specific value from CLOB (containing XML) while creating one delimited string per row of a table. CLOB value may be null on some rows

Some Context: The DB is Oracle. I am trying to create one delimited string per row of a table. Some of the values of the delimited string must come from CLOBs (containing XML). The CLOBs may be null on some rows and this is where the issue lies. For…
James Gallagher
  • 389
  • 2
  • 4
  • 12