ORA 1461 Error

ORA 1461 Error

Post by Ajay Daman » Mon, 30 Nov 1998 04:00:00



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

 
 
 

1. ORA 1461 Error while trying to insert into a CLOB column

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.5.0.5 of the JDBC drivers obtained from Oracle 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 that the
size limit is 4k). 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 really 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.

2.  If I can somehow convert my string (mydata) to an OracleClob, then I
    can use the setClob method to do the insert.  Can I do this?

Any help is greatly appreciated.  Thanks.

-Ajay

2. benchmark

3. ORA-01115,ORA-01110,ORA-27070,OSD-04006,O/S-Error OS 38

4. Oracle performance tuning

5. ORA-600, ORA-8177, ORA-6512 Errors via ODBC

6. How 2 Filter on Report in Pal

7. Create new DB errors (ORA-01610, ORA-01194, ORA-01110)

8. Progress 7.2D from Win 3.11 to Win 95 or 98 -> Report Builder BUG

9. Error: ORA-01034, ORA-09243, ORA-02042

10. ORA-12154: Error while trying to retrieve text for error ORA-12154

11. ORA-01034 , ORA-27101 , IBM AIX RISC System/6000 Error: 2

12. Oracle Errors ORA-03113 and ORA-01041

13. Oracle errors ORA-312 and ORA-313