Hi folks!
I am getting the following error while trying to insert something into an
Oracle8 database:
"java.sql.SQLException: ORA-01461: can bind a LONG value only for insert
into a LONG column"
I am using v8.0.4.0.6 of the JDBC drivers obtained from Oracle's website
together with JDK 1.1.6. My column type is a CLOB and this only happens
while trying to insert something over a certain size (i believe 32K is the
limit). My question is as follows:
1. Is there a better way to insert something into a CLOB column of an
Oracle8 database without encountering the above error message and
overcoming the size limit? Currently I am using the following
code:
// this can be something as big as you can imagine.
String mydata = "something reallly really long";
int len = mydata.length();
BytaArrayInputStream bais = new ByteArrayInputStream(mydata.toBytes());
PreparedStatement ps = conn.prepeareStatement("insert into mytable
values (?)");
ps.setAsciiStream(1,bais,len);
// Also tried the following:
// ps.setString(1,outputstream.toString());
ps.execute();
ps.close();
This does the insert for data of a certain size but croaks on anything
that is over the size limit.
Any help is greatly appreciated. Thanks.
-Ajay