clob

ORA-22835 using JPA (Buffer too small)

I am trying to persist an Entity with a @Lob annotated String field. The content of that fiels if bigger than the 40k buffer size limit. The first problem I had was related to the setString method used internally by the JPA implementation (Hibernate in my case) and the Oracle JDBC Driver. This problem was solved adding <property n...

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 into the database. I've used all sorts of combinations of versions of the: Oracle JDB...

Consuming XML directly in AXIS2

Hi, I have a scenario where I get XML from client to server which exposes REST web services using AXIS2. I want to directly store this XML to DB (without converting into Java object), with some more information like user to whom XML belongs etc. I might store XML as We also have hibernate in the same application for ORM. Now my questi...

How to read a CLOB column in Oracle using OleDb ?

Hi, 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 using OleDb connection, I get an exception. Here is the code I use : using (OleDbCon...

Oracle PL/SQL: Performance of CLOB data type in PL/SQL

If I use many CLOB variables in the PL/SQL stored procedure to store many long length string , are there any performance issues? Is the length of the CLOB is also variable? Are there any known limitations/disadvantages for CLOB instead using varchar2 and long? ...

How to create a Clob in JPA in an implementation agnostic way

Hello I am using Ejb3 and JPA (based on Hibernate and Oracle 10g at the moment) I have an entity that contains a clob @Entity @Table(name = "My_TAB") public class ExampleEntity implements java.io.Serializable { private Clob someText; public void setSomeText(Clob someText) { this.someText= someText; } @Column...

oracle clob insertion problem in spring

Hi, I want to insert CLOB value into my Oracle database and here is the what I could do. I got this exception while inserting operation "ORA-01461: can bind a LONG value only for insert into a LONG column". Would someone able to tell me what should I do? Thanks. List<Object> listObjects = dao.selectAll("TABLE NAME", new XRowMapper()); S...

Clob as param for PL/SQL Java Stored Procedure

I have a java stored procedure that takes in a clob representing a chunk of javascript and mins it. The structure of the function calling the JSP is as follows: function MIN_JS(pcl_js in clob) return clob as language java name 'JSMin.min(oracle.sql.CLOB) return oracle.sql.CLOB'; In the actual JSP, I have the following: import orac...

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? ...

How do I store a string longer than 4000 characters in an Oracle Database using Java/JDBC?

I’m not sure how to use Java/JDBC to insert a very long string into an Oracle database. I have a String which is greater than 4000 characters, lets say it’s 6000. I want to take this string and store it in an Oracle database. The way to do this seems to be with the CLOB datatype. Okay, so I declared the column as description CLOB. N...

How to store unlimited characters in Oracle 11g?

We have a table in Oracle 11g with a varchar2 column. We use a proprietary programming language where this column is defined as string. Maximum we can store 2000 characters (4000 bytes) in this column. Now the requirement is such that the column needs to store more than 2000 characters (in fact unlimited characters). The DBAs don't like ...

Concatenate CLOB-rows with PL/SQL

Hi, I've got a table which has an id and a clob content like: Create Table v_example_l ( nip number, xmlcontent clob ); We insert our data: Insert into V_EXAMPLE_L (NIP,XMLCONTENT) Values (17852,'<section><block><name>delta</name><content>548484646846484</content></block></section>'); Insert into V_EXAMPLE_L (NIP,XMLCONTENT...

Concatenation of CLOB datatypes in a LOOP in PL/SQL

Good Day Gurus, I am trying to concatenate clobs in a PL/SQL loop and it has been returning null whilst when using DBMS_OUTPUT prints out the loop values and when executing each result of the clobs gives an output as well. The system is meant to execute an already stored SQL in a table based on the report name passed into it. This part...

Is it possbile to update data inside a CLOB using SQL ?

I have a table having one clob column which has XML data in it. say i want to replace XYZ with ABC in clob column. Is it possible using sqlplus? ...

Will CLOB data be truncated when displayed in a SELECT query? If so, how can it be displayed?

Hi folks, I've got a Varchar2 field in my table which I want to convert to a CLOB. I am unsure whether the data would get truncated when selected. If so, what is the limit and does it depend on the database settings? In my TOAD or SQLPLUS window it gets truncated but this may just be the environment settings. I'm not sure whether it wo...

Hibernate+Oracle+Clob: Content of attributes get switched.

Has anyone heard of this error before: I have a Java 5 application, that uses Hibernate 3.3.2 to access an Oracle Database 10g, the JDBC driver is the Oracle light driver version 10.2.0.4.0 (the most recent version, I think). The database access happens during a transaction that is managed via the AOP-tools of spring. There is one datab...

JDBC: Converting Clobs to Strings doesn't show \n line returns

Hi, I am connecting to a 4D (fourth dimension brand) database with its crappy jdbc driver. I have a CLOB on the database and when I fetch it either through getString or getClob, I don't get line returns, everything seems to come in one line. But, if I do do a select on NetBeans database explorer and I copy and paste the value on the ...

Oracle NCLOB Problem

I have the following function: CREATE OR REPLACE FUNCTION GetVarchar2 (iclCLOB IN Nvarchar2) return NVARCHAR2 IS cnuMAX_LENGTH Constant number := 32767 ; nuLength Number := DBMS_LOB.getlength(iclCLOB); sbBuffer Nvarchar2(32767); begin dbms_lob.read(iclCLOB,nuLength,1,sbBuffer); return sbBuffer; END; when I call it like this: select G...

Oracle clob over dblink with different charset

Hello, Here is the scenario: Oracle A: charset WE8ISO8859P1 Oracle B: charset WE8MSWIN1252 Oracle A <- dblink -> Oracle B I can't access Oracle B directly, firewall issues :( I have to get some binary files from OracleB and these files are in a column of type CLOB (don't ask me why and I can't change to BLOB). I'm using a "select ...

"ORA-01036: illegal variable name/number\n" for oracle clob in C#

When I try to create an oracle stored procedure call with clob input and output in C#, I get the following error: ORA-01036: illegal variable name/number\n Here's the code itself: OracleTransaction transaction = connection.BeginTransaction(); OracleCommand command = connection.CreateCommand(); command.Transaction = transaction; comma...