Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: ORA-01461: Error Code

Re: ORA-01461: Error Code

From: KISHORE <kishore.chekuri_at_geind.ge.com>
Date: Sat, 21 Oct 2000 07:30:04 -0000
Message-ID: <sv2hfs4t2aqpc3@corp.supernews.com>

nachimuthu,

    Do you have any solution for your question?I have a similar problem.I read a string from the user and use the below code to insert that string into CLOB column.
try{                 

connectionBean=JdbcBeanFactory.getJdbcConnectionBeanInstance("geisnet");

                connectionBean.leaseConnection();
                conn=connectionBean.getConnection();
                String pricing=new String(this.bundlePricingDetails);
PreparedStatement stmt=conn.prepareStatement("INSERT INTO PRICE_BUNDLE_CODE (BUNDLE_CODE, COUNTRY_ID, SOLUTION_ID, DESCRIPTION,PRICING_SCHEDULES) VALUES (?,?,?,?,?)");
                stmt.setString(1,this.bundleCode);
                stmt.setInt(2,this.countryId);
                stmt.setInt(3,this.solutionId);
                stmt.setString(4,this.bundleDescription);
                stmt.setClob(5,new 

oracle.sql.CLOB((oracle.jdbc.driver.OracleConnection) conn,pricing.getBytes()));
                                
                stmt.executeUpdate();

stmt.close();
                rs.close();
                }
            catch(SQLException sqle)
                {
                    
                    System.out.println("Sql exception Caught in the 
PoolTesting file try block"+sqle);
                }
            catch(Exception e)
                {
                    System.out.println("Generic Exception caught in 
BundleCode class"+e);
                }
            finally
                {
                    if(connectionBean!=null)
                        connectionBean.returnConnection();
                } 
            
                

Then I get the error as:
Sql exception Caught in the PoolTesting file try blockjava.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column

Can you solve this immediately if you know ? Waiting for your reply.

                          -KISHORE


nachimuthu wrote:
>
>
> I'm trying to insert a record through a JavaBean into the Oracle 8i
> database. The Column being inserted is of type CLOB. But, we treat
> the value being inserted into that column in the bean as String and it
> works fine... Well... so far....
>
> Now we have come across a problem.
> java.sql.SQLException: ORA-01461: can bind a LONG value only for insert
> into a LONG column
>
>
> The length of the String being inserted is little more than 22,000
> characters.
>
> Below is the partial stack trace...
>
> java.sql.SQLException: ORA-01461: can bind a LONG value only
> for insert into a LONG column
> java.sql.SQLException: ORA-01461: can bind a LONG value only for insert
> into a LONG column
> at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:228)
> at weblogic.jdbcbase.oci.Statement.executeUpdate
> (Statement.java, Compiled Code)
> at weblogic.jdbc.pool.PreparedStatement.executeUpdate
> (PreparedStatement.java, Compiled Code)
> at
> com.ctone.services.persistence.OfferDetailPSWebLogic_CMP_RDBMS.create
> (OfferDetailPSWebLogic_CMP_RDBMS.java:161)
> at
> com.ctone.services.persistence.OfferDetailPSWebLogic_CMP_RDBMS.create
> (OfferDetailPSWebLogic_CMP_RDBMS.java:125)
> at weblogic.ejb.internal.EntityEJBContext.create
> (EntityEJBContext.java:118)
> at weblogic.ejb.internal.StatefulEJBObject.postCreate
> (StatefulEJBObject.java:266)
>
> My questions are...
>
> a) Is this a limitation imposed due to the length of the String
> variable (for smaller lengths, the code works perfectly fine...)
>
> b) Also, any idea where I could get the detailed explanation on the
> error given the error code? I know there is site/documentation
> available for that. I'm just not able to recollect the address.
>
>
> Thanks In Advance for any help...
>
> - Muthu
>
>
>
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

--
Posted via CNET Help.com
http://www.help.com/
Received on Sat Oct 21 2000 - 02:30:04 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US