File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes inserted value too large for column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "inserted value too large for column" Watch "inserted value too large for column" New topic
Author

inserted value too large for column

satish kumar
Greenhorn

Joined: Nov 26, 2004
Posts: 18
I am getting 'inserted value too large for column' error but how can I tell which column is causing the problem? Can I know that information from SQLException object?
[ December 22, 2004: Message edited by: Bear Bibeault ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
how are you getting this "inserted value too large for the column".
are you doing sqlException.printStackTrace()?
satish kumar
Greenhorn

Joined: Nov 26, 2004
Posts: 18
Yes...I've included output of sqlExcp.printStackTrace() too

java.sql.SQLException: ORA-01401: inserted value too large for column

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:878)
at acrostics.TestOracle.<init>(TestOracle.java:34)
at acrostics.TestOracle.main(TestOracle.java:64)
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Satish,

how can I tell which column is causing the problem

As far as I know, you can't.
[Note: You may be able to in Oracle 10g, but I'm still on Oracle 9i.]
You just have to check the SQL statement that you are sending to the
database.

For example, if you are trying to enter the string "several" into a column
that is defined as VARCHAR2(5), you will get this error.

If it is difficult for you to check the SQL, then perhaps try "P6 Spy":

http://www.p6spy.com

Good Luck,
Avi.
satish kumar
Greenhorn

Joined: Nov 26, 2004
Posts: 18
I found out which column was causing the problem by looking at data dictionary and my SQL. I am a bit disappointed that system can't specify which column is too large. Is it driver limitation or database limitation?
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
Originally posted by satish kumar:
Is it driver limitation or database limitation?
I suspect it's the database. Issuing the same SQL in SQL*Plus results in the same message without the table/column. Luckily, when you violate a constraint it tells you its name!
Nitin Jawarkar
Ranch Hand

Joined: Dec 18, 2004
Posts: 79
Satish,

First of all try the same sql command in your oracle database
still it will give the same then you should check the limitations of your table, like datatype,indexing etc.
Thanx


Cheers<br />Nitin
 
Consider Paul's rocket mass heater.
 
subject: inserted value too large for column