File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes oracle exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "oracle exception" Watch "oracle exception" New topic

oracle exception

vasu maj
Ranch Hand

Joined: Jul 12, 2001
Posts: 396
I have stored procedure which takes in a bunch of paramaters and inserts a row in a table. When one of the parameters happens to be larger than the size of the column of the database table I am gettting back an error whose decription is "value trying to insert is larger than the column size". It takes me some time figuring out which column it is complaining about. We are going to do some validation at the UI but I was curious to knwo if there is a way to get back the name of the column in the error message. Can we force Oracle to give more descriptive error which includes the name of the column?



What a wonderful world!
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33132

I don't think that is possible. You could use metadata to check the size of each column before inserting the row. But this is slow and you are better off just sticking some constants in a file somewhere.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: oracle exception
It's not a secret anymore!