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
20
votes
5 answers

How do I test if a column equals empty_clob() in Oracle?

The naïve FOO = empty_clob() complains about incompatible types. I tried Googling, but (once again) had little success searching for help with Oracle. Thanks.
Hank Gay
  • 70,339
  • 36
  • 160
  • 222
19
votes
3 answers

Extract data from XML Clob using SQL from Oracle Database

I want to extract the value of Decision using sql from table TRAPTABCLOB having column testclob with XML stored as clob. Sample XML as below. Success
mitrabhanu
  • 389
  • 1
  • 2
  • 13
19
votes
4 answers

How to convert CLOB to VARCHAR2 inside oracle pl/sql

I have a clob variable, need to assign it to varchar2 variable. The data inside clob var is less than 4000 (i..e varchar2's maxsize) oracle10+ I tried report_len := length(report_clob); report := TO_CHAR(dbms_lob.substr(report_clob,…
Munish Goyal
  • 1,379
  • 4
  • 27
  • 49
18
votes
1 answer

How to insert/update larger size of data in the Oracle tables?

I want to insert large size of data that character length is more than 10,000. I used CLOB data type to each column. I can't insert/update that large data it shows following error: ORA-01704: string literal too long My code insert into table1…
18
votes
3 answers

Error- ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion

I am attempting to read a BLOB message and display it as a variable in one of my procedures, but am getting the error below: Error - ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 9923, maximum: 2000) I have…
kumarb
  • 521
  • 1
  • 7
  • 23
18
votes
3 answers

Oracle CLOB can't insert beyond 4000 characters?

How do I insert more than 4000 characters to a CLOB type column? --create test table s create table s ( a clob ); insert into s values('>4000 char') Results in an error: ORA-01704:the string too long. I want to insert a string of >4000…
Dolphin
  • 29,069
  • 61
  • 260
  • 539
17
votes
10 answers

Java: How to insert CLOB into oracle database

I need to write an XML file content into oracle database where the column is of CLOB datatype. How will I do that?
Ianthe
  • 5,559
  • 21
  • 57
  • 74
17
votes
4 answers

check if clob contains string oracle

currently i have query with this code to_char(CLOB_COLUM) like %s but the following wont work for very big clob. Is there another solution to check if this column contains some string. Using oracle 11.2.0.4.0
xMilos
  • 1,519
  • 4
  • 21
  • 36
17
votes
5 answers

How to show CLOB type in a SELECT in SQL Server?

I have a table with one column of CLOB type data, they are all very short no more than 20 bytes, however I cannot see the actual string in the CLOB data. For example if I use SELECT *, under the CLOB type every data is like: CLOB, 8 Bytes CLOB, 15…
tomriddle_1234
  • 3,145
  • 6
  • 41
  • 71
16
votes
6 answers

alternative to listagg in Oracle?

listagg is a function introduced in Oracle 11.2! now this function is bugging us allot, we are migrating from MySQL to Oracle and we have this query: SELECT p_id, MAX(registered) AS registered, listagg(MESSAGE, ' ') within GROUP (ORDER…
Data-Base
  • 8,418
  • 36
  • 74
  • 98
16
votes
4 answers

Lazily loading a clob in hibernate

There's a lot one can find about this googling a bit but I haven't quite found a workable solution to this problem. Basically what I have is a big CLOB on a particular class that I want to have loaded on demand. The naive way to do this would…
wds
  • 31,873
  • 11
  • 59
  • 84
15
votes
3 answers

Why has Hibernate switched to use LONG over CLOB?

It looks like that Hibernate started using LONG data type in version 3.5.5 (we upgraded from 3.2.7) instead of CLOB for the property of type="text". This is causing problems as LONG data type in Oracle is an old outdated data type (see…
mindas
  • 26,463
  • 15
  • 97
  • 154
14
votes
3 answers

How to generate JSON in Oracle for a CLOB that is > 32k (e.g. 60,000 characters)?

1 ) I have to make json from oracle select query which has three approach i can follow . SELECT JSON_ARRAY(json_object('id' VALUE employee_id, 'data_clob' VALUE data_clob )) from tablename; also i…
Himanshu sharma
  • 7,487
  • 4
  • 42
  • 75
14
votes
7 answers

Convert String to Clob in Java

I have a situation where I need to make Clob object from String. The problem is I can't have ConnectionManager in that method. I need to some utility like public Clob getClob(String data){ } Can any one tell me how can I make this. I have…
RaceBase
  • 18,428
  • 47
  • 141
  • 202
13
votes
3 answers

insert string which includes quotes in oracle

How can I insert string which includes quotes in oracle? my code is INSERT INTO TIZ_VADF_TL_MODELS (name) VALUES ('xxx'test'yy'); if I use INSERT INTO TIZ_VADF_TL_MODELS (name) VALUES ("xxx'test'yy"); I get identifier is too long error because…
neverwinter
  • 810
  • 2
  • 15
  • 42
1
2
3
71 72