Operating System - HP-UX
1824974 Members
4309 Online
109678 Solutions
New Discussion

More detail from SQLException

 
Leslie Chaim
Regular Advisor

More detail from SQLException

My application reads (or obtains) SQL instructions from various sources and they get executed to my Oracle database.

Often times there may be errors in the SQL since it is purely dynamic.
The nature of the errors can be any of the following:

Value larger then specified for this columns
Invalid column name
Null constraint violated
Invalid number
...

I am still new to JDBC but I would like to get the complete message from the Oracle database engine. Using Pro*C I can get it from the sqlca structure and/or from sqlglm(), when using OCI I get it from the oerhms() routine.

To be more specific I need the exception handler to report what column is invalid, or which column's constraints were violated. However, I realize that I may have to go the MetaData route for that. Nevertheless, in all cases isn't there a way to at least get the complete message from the Oracle database engine?

Thanks,
If life serves you lemons, make lemonade