aspose file tools*
The moose likes JDBC 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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "oracle exception" Watch "oracle exception" New topic
Author

oracle exception

vasu maj
Ranch Hand

Joined: Jul 12, 2001
Posts: 395
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?


Thanks,

Vasu


What a wonderful world!
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Vasu,
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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: oracle exception