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
7
votes
2 answers

SELECT as much data from CLOB to VARCHAR2 as possible, with multibyte chars in the data

Multi-byte characters had caused me a lot of pain. Any suggestion for this problem? I have a CLOB field that might contains some multi-byte characters, and I need to select in SQL and convert this field into a string for downstream process,…
alchn
  • 327
  • 1
  • 5
  • 16
7
votes
5 answers

How to convert a CLOB data type to a String in Hibernate?

In hibernate (3.2.1.GA), I use the following method to insert CLOB type data into Oracle (10g) database. Hibernate.createClob(parameters.get("txtCatImage")); parameters is a Map where all the request parameters have been stored. While retrieving…
Tiny
  • 27,221
  • 105
  • 339
  • 599
7
votes
3 answers

DB2 cast a large CLOB (> 32KB) into text?

I have a DB2 (9.5.1) table which is defined as follows: CREATE TABLE MY_TABLE ( ID INTEGER DEFAULT 0 NOT NULL, TEXT CLOB(104857600), PRIMARY KEY (ID) ); Now if I want to query the actual text string that is stored in the CLOB I do it…
Peter Meier
  • 483
  • 3
  • 7
  • 17
6
votes
3 answers

Inserting Clob with NamedParameterJdbcTemplate

I usually use the lobHandler + JdbcTemplate + PreparedStatementSetter triplet to insert my Clob into the database, as I saw on http://www.java2s.com/Code/Java/Spring/InsertClobData.htm My question is how to do this with a NamedParameterJdbcTemplate?…
jabal
  • 11,987
  • 12
  • 51
  • 99
6
votes
0 answers

DB2 insert clob [String constant too long]

I'm trying to insert some rows in a DB2 table which has a CLOB column. The limit I found is that I cannot insert a String constant bigger than 32KB and I can't shorten it because it's a JSON String. I'm willing to use as it is returned from the web…
mmuca
  • 61
  • 5
6
votes
2 answers

Create CLOB from long string using JDBC

I have the following query: select id from table1 where some_func(?) = 1; where some_func is a function which allows its arguments to be either VARCHAR2 or CLOB, and ? is some string, which could be really long. I am trying to use the following…
taurus
  • 213
  • 1
  • 3
  • 9
6
votes
2 answers

Retrieve large clob data using sqlplus

How to completely retrieve large clob data from a table using sqlplus to the stdout? There is a way to get it completely using language specific DB APIs. But when I try to get it using purely sqlplus, I've faced several problems such as, Output…
Amith Chinthaka
  • 1,015
  • 1
  • 17
  • 24
6
votes
3 answers

inconsistent datatypes: expected - got CLOB for table join

Oracle XE 11. a very simple join query gave me the following error: ORA-00932: inconsistent datatypes: expected - got CLOB Tables: Product ---------------------------------- id, name, description, categoryId Catetory ------------------ id,…
Dave
  • 759
  • 2
  • 9
  • 31
6
votes
1 answer

Temporary tablespace of CLOB not freed

I have the Problem that my Java-Application is exporting a larger amount of clobs from a database, but always runs out of temporary tablespace as the old clobs are not freed. A simplified code example how I do it would be: public void…
Simon M
  • 61
  • 1
  • 4
6
votes
1 answer

Loading a file into a clob

Given a url pointing to a file hosted on the webserver, is it possible to read the contents of that url into a clob? And if so, how?
JDS
  • 1,233
  • 4
  • 15
  • 27
6
votes
1 answer

How to read a CLOB column in Oracle using OleDb?

I have created a table on an Oracle 10g database with this structure : create table myTable ( id number(32,0) primary key, myData clob ) I can insert rows in the table without any problem, but when I try to read data from the table…
Thibault Falise
  • 5,795
  • 2
  • 29
  • 32
5
votes
1 answer

Poor performance getting clob field from Oracle in .Net

I am trying to read a clob column from oracle in .Net and observing very poor performance and lots of network traffic. I have tried ODP+OCI, devArt+OCI ways to access the data with the same results - it takes around 20 seconds to get 1000 rows in a…
neonknight
  • 121
  • 2
  • 5
5
votes
2 answers

Dumping CLOB fields into files?

Say you have the table: Column_name | data_type Title | Varchar2 Text | CLOB with some rows: SomeUnkownMovie | A long time ago in a galaxy far, far away....(long text ahead) FredMercuryBio | Awesomeness and stuff....(more long…
filippo
  • 5,583
  • 13
  • 50
  • 72
5
votes
3 answers

Mapping a long text string in Oracle and NHibernate

Using NHibernate 3.1 with both SQL Server and Oracle DBs, we need to store a text string that is longer than 4000 characters. The text is actually XML, but that is not important - we just want to treat it as raw text. With SQL Server, this is easy.…
Brian Berns
  • 15,499
  • 2
  • 30
  • 40
5
votes
3 answers

Sybase TEXT vs Oracle CLOB performance

We're in the process of converting our database from Sybase to Oracle and we've hit a performance problem. In Sybase, we had a TEXT field and replaced it with a CLOB in Oracle. This is how we accessed the data in our java code: while(rs.next()) { …
wsaxton
  • 1,030
  • 15
  • 34